diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-09 02:47:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-09 02:47:32 +0800 |
commit | 6184781b49242b8029522612ad94cd45b508abc1 (patch) | |
tree | 4e8822e2000a885018e712b9cefb2a2ac3a512ca /core/state/statedb.go | |
parent | a7750c929b926d164195fd4f7a7e2b4642c66173 (diff) | |
download | go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.gz go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.bz2 go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.lz go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.xz go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.zst go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.zip |
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
Diffstat (limited to 'core/state/statedb.go')
-rw-r--r-- | core/state/statedb.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go index 0651365f0..b3050515b 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -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) |