diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-23 17:51:04 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-23 17:51:04 +0800 |
commit | 3a9a252f6e44abb0f45f57a46c0fa91e2f73c545 (patch) | |
tree | 677575939c8f22c30a9601c205450a0d5b98c3ab /ethchain/transaction_pool.go | |
parent | 61cd1594b52514244efcb47bd93722aaec0fe456 (diff) | |
download | dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar.gz dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar.bz2 dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar.lz dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar.xz dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.tar.zst dexon-3a9a252f6e44abb0f45f57a46c0fa91e2f73c545.zip |
Fixed minor issue with gas and added state object init
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r-- | ethchain/transaction_pool.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index 5cdda17e2..957381ac7 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -104,7 +104,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract // funds won't invalidate this transaction but simple ignores it. totAmount := new(big.Int).Add(tx.Value, new(big.Int).Mul(TxFee, TxFeeRat)) if sender.Amount.Cmp(totAmount) < 0 { - return errors.New("[TXPL] Insufficient amount in sender's account") + return fmt.Errorf("[TXPL] Insufficient amount in sender's (%x) account", tx.Sender()) } if sender.Nonce != tx.Nonce { @@ -119,8 +119,6 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract if bytes.Compare(tx.Recipient, tx.Sender()) == 0 { // Subtract the fee sender.SubAmount(new(big.Int).Mul(TxFee, TxFeeRat)) - } else if toContract { - sender.SubAmount(new(big.Int).Mul(TxFee, TxFeeRat)) } else { // Subtract the amount from the senders account sender.SubAmount(totAmount) |