Re-added min gas price check on tx pool

This commit is contained in:
obscuren
2014-09-23 17:55:34 +02:00
parent ea67d853a8
commit 6800c3665a
3 changed files with 37 additions and 12 deletions

View File

@@ -27,6 +27,8 @@ const (
minGasPrice = 1000000
)
var MinGasPrice = big.NewInt(10000000000000)
type TxMsg struct {
Tx *Transaction
Type TxMsgTy
@@ -103,6 +105,10 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error {
return fmt.Errorf("[TXPL] Invalid recipient. len = %d", len(tx.Recipient))
}
if tx.GasPrice.Cmp(MinGasPrice) >= 0 {
return fmt.Errorf("Gas price to low. Require %v > Got %v", MinGasPrice, tx.GasPrice)
}
// Get the sender
//sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
sender := pool.Ethereum.StateManager().CurrentState().GetAccount(tx.Sender())