Improved transaction pool

The transaction pool will now some easily be able to pre determine the
validity of a transaction by checking the following:

* Account existst
* gas limit higher than the instrinsic gas
* enough funds to pay upfront costs
* nonce check
This commit is contained in:
obscuren
2015-04-08 20:47:32 +02:00
parent a7750c929b
commit 6184781b49
8 changed files with 111 additions and 149 deletions

View File

@ -63,14 +63,6 @@ func (self *StateDB) Logs() Logs {
return logs
}
/*
func (self *StateDB) Logs(txHash, blockHash common.Hash, txIndex uint) Logs {
self.logs.SetInfo(txHash, blockHash, txIndex)
return self.logs
}
*/
func (self *StateDB) Refund(address common.Address, gas *big.Int) {
addr := address.Str()
if self.refund[addr] == nil {
@ -83,6 +75,10 @@ func (self *StateDB) Refund(address common.Address, gas *big.Int) {
* GETTERS
*/
func (self *StateDB) HasAccount(addr common.Address) bool {
return self.GetStateObject(addr) != nil
}
// Retrieve the balance from the given address or 0 if object not found
func (self *StateDB) GetBalance(addr common.Address) *big.Int {
stateObject := self.GetStateObject(addr)