From ce116681c5e67162d0b581b951ce0e385995a6cd Mon Sep 17 00:00:00 2001 From: David Dworken Date: Wed, 5 Aug 2015 21:46:24 -0400 Subject: [PATCH] Throw exception in a manner that matches behavior of nodes See behavior of go-ethereum here: https://github.com/ethereum/go-ethereum/blob/80e5f507130a926ea62dde07c2b98d6f8a0ba3e2/core/block_processor.go#L378 See behavior of cpp-ethereum here: https://github.com/ethereum/cpp-ethereum/blob/09e5dbfa06055498ddeaa4dcbd30a36a7dcc4462/libethcore/Ethash.cpp#L99 --- rpc/api/miner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/api/miner.go b/rpc/api/miner.go index 3c3d1ee0b3..4cec1e79ce 100644 --- a/rpc/api/miner.go +++ b/rpc/api/miner.go @@ -126,7 +126,7 @@ func (self *minerApi) SetExtra(req *shared.Request) (interface{}, error) { return nil, err } - if uint64(len(args.Data)) > params.MaximumExtraDataSize.Uint64()*2 { + if uint64(len(args.Data)) > params.MaximumExtraDataSize.Uint64() { return false, fmt.Errorf("extra datasize can be no longer than %v bytes", params.MaximumExtraDataSize) }