[txPool] fix the build bug

pull/3648/head
Jacky Wang 4 years ago
parent b20f8f1edf
commit f448216e58
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 2
      core/tx_pool.go

@ -846,7 +846,7 @@ func (pool *TxPool) validateStakingTx(tx *staking.StakingTransaction) error {
} }
// We need to deduct gas price and verify balance since txn.Cost() is not accurate for delegate // We need to deduct gas price and verify balance since txn.Cost() is not accurate for delegate
// staking transaction because of re-delegation. // staking transaction because of re-delegation.
gasAmt := new(big.Int).Mul(tx.GasPrice(), new(big.Int).SetUint64(tx.GasLimit()))) gasAmt := new(big.Int).Mul(tx.GasPrice(), new(big.Int).SetUint64(tx.GasLimit()))
totalAmt := new(big.Int).Add(delegateAmt, gasAmt) totalAmt := new(big.Int).Add(delegateAmt, gasAmt)
if bal := pool.currentState.GetBalance(from); bal.Cmp(totalAmt) < 0 { if bal := pool.currentState.GetBalance(from); bal.Cmp(totalAmt) < 0 {
return fmt.Errorf("not enough balance for delegation: %v < %v", bal, delegateAmt) return fmt.Errorf("not enough balance for delegation: %v < %v", bal, delegateAmt)

Loading…
Cancel
Save