Skip mining on transactions that don't meet the min accepted gas price

This commit is contained in:
obscuren
2014-12-04 23:54:07 +01:00
parent 3db9c80070
commit 8dbca75d85
3 changed files with 32 additions and 26 deletions

View File

@ -115,10 +115,6 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
return fmt.Errorf("tx.v != (28 || 27)")
}
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.BlockManager().CurrentState().GetAccount(tx.Sender())
@ -169,6 +165,10 @@ func (self *TxPool) Add(tx *types.Transaction) error {
return nil
}
func (self *TxPool) Size() int {
return self.pool.Len()
}
func (pool *TxPool) CurrentTransactions() []*types.Transaction {
pool.mutex.Lock()
defer pool.mutex.Unlock()