mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
Accept input as either hex or a string with correct length handling for both
This commit is contained in:
parent
ce116681c5
commit
3b4000a1f5
1 changed files with 4 additions and 0 deletions
|
|
@ -126,6 +126,10 @@ func (self *minerApi) SetExtra(req *shared.Request) (interface{}, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if common.IsHex(args.Data) {
|
||||||
|
args.Data = string(common.FromHex(args.Data)) //convert the byte array back to a string
|
||||||
|
}
|
||||||
|
|
||||||
if uint64(len(args.Data)) > params.MaximumExtraDataSize.Uint64() {
|
if uint64(len(args.Data)) > params.MaximumExtraDataSize.Uint64() {
|
||||||
return false, fmt.Errorf("extra datasize can be no longer than %v bytes", params.MaximumExtraDataSize)
|
return false, fmt.Errorf("extra datasize can be no longer than %v bytes", params.MaximumExtraDataSize)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue