|
|
@ -20,7 +20,6 @@ import ( |
|
|
|
"bytes" |
|
|
|
"bytes" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"math/big" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/signer/core/apitypes" |
|
|
|
"github.com/ethereum/go-ethereum/signer/core/apitypes" |
|
|
@ -57,7 +56,7 @@ func (db *Database) ValidateTransaction(selector *string, tx *apitypes.SendTxArg |
|
|
|
// e.g. https://github.com/ethereum/go-ethereum/issues/16106.
|
|
|
|
// e.g. https://github.com/ethereum/go-ethereum/issues/16106.
|
|
|
|
if len(data) == 0 { |
|
|
|
if len(data) == 0 { |
|
|
|
// Prevent sending ether into black hole (show stopper)
|
|
|
|
// Prevent sending ether into black hole (show stopper)
|
|
|
|
if tx.Value.ToInt().Cmp(big.NewInt(0)) > 0 { |
|
|
|
if tx.Value.ToInt().Sign() > 0 { |
|
|
|
return nil, errors.New("transaction will create a contract with value but empty code") |
|
|
|
return nil, errors.New("transaction will create a contract with value but empty code") |
|
|
|
} |
|
|
|
} |
|
|
|
// No value submitted at least, critically Warn, but don't blow up
|
|
|
|
// No value submitted at least, critically Warn, but don't blow up
|
|
|
|