diff --git a/core/tx_pool.go b/core/tx_pool.go index 0c422dd99d..f97ea69351 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -509,7 +509,7 @@ func (pool *TxPool) local() map[common.Address]types.Transactions { func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { // Heuristic limit, reject transactions over 32KB to prevent DOS attacks if tx.Size() > 32*1024 { - return ErrOversizedData + return fmt.Errorf("%v your txSize:%d;limitSize:%d", ErrOversizedData, tx.Size(), 32*1024) } // Transactions can't be negative. This may never happen using RLP decoded // transactions but may occur if you create a transaction using the RPC. @@ -518,26 +518,26 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { } // Ensure the transaction doesn't exceed the current block limit gas. if pool.currentMaxGas < tx.Gas() { - return ErrGasLimit + return fmt.Errorf("%v currentMaxGas:%d;tx.Gas():%d", ErrGasLimit, pool.currentMaxGas, tx.Gas()) } // Make sure the transaction is signed properly from, err := types.Sender(pool.signer, tx) if err != nil { - return ErrInvalidSender + return fmt.Errorf("%v err is:%v", ErrInvalidSender, err) } // Drop non-local transactions under our own minimal accepted gas price local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 { - return ErrUnderpriced + return fmt.Errorf("%v pool.gasPrice:%d;tx.GasPrice():%d", ErrUnderpriced, pool.gasPrice, tx.GasPrice()) } // Ensure the transaction adheres to nonce ordering if pool.currentState.GetNonce(from) > tx.Nonce() { - return ErrNonceTooLow + return fmt.Errorf("%v current pool nonce:%d;tx.Nonce():%d", ErrNonceTooLow, pool.currentState.GetNonce(from), tx.Nonce()) } // Transactor should have enough funds to cover the costs // cost == V + GP * GL if pool.currentState.GetBalance(from).Cmp(tx.Cost()) < 0 { - return ErrInsufficientFunds + return fmt.Errorf("%v your balance:%d;tx.Cost():%d", ErrInsufficientFunds, pool.currentState.GetBalance(from), tx.Cost()) } // Ensure the transaction has more gas than the basic tx fee. intrGas, err := IntrinsicGas(tx.Data(), tx.To() == nil, true) @@ -545,7 +545,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { return err } if tx.Gas() < intrGas { - return ErrIntrinsicGas + return fmt.Errorf("%v your intrGas:%d;tx.Gas():%d", ErrIntrinsicGas, intrGas, tx.Gas()) } return nil }