diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-11-20 19:18:39 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-11-23 16:34:01 +0800 |
commit | aad4890082c1624795991d534db9497c8b63630d (patch) | |
tree | 88dca9b73bdcdea2cbed32471c37933c308ac54d /core | |
parent | a0e42aa4e206247efe6df8706a2fb6bbdf6074b4 (diff) | |
download | dexon-aad4890082c1624795991d534db9497c8b63630d.tar.gz dexon-aad4890082c1624795991d534db9497c8b63630d.tar.zst dexon-aad4890082c1624795991d534db9497c8b63630d.zip |
cmd/geth, core, light, mobile: removed state account StartingNonce
All account's nonce start at 0.
Diffstat (limited to 'core')
-rw-r--r-- | core/genesis.go | 4 | ||||
-rw-r--r-- | core/state/statedb.go | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/core/genesis.go b/core/genesis.go index 8509f664d..44a83f236 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -43,7 +43,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, } var genesis struct { - ChainConfig *params.ChainConfig `json:"config"` + ChainConfig params.ChainConfig `json:"config"` Nonce string Timestamp string ParentHash string @@ -115,7 +115,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, if err := WriteHeadBlockHash(chainDb, block.Hash()); err != nil { return nil, err } - if err := WriteChainConfig(chainDb, block.Hash(), genesis.ChainConfig); err != nil { + if err := WriteChainConfig(chainDb, block.Hash(), &genesis.ChainConfig); err != nil { return nil, err } diff --git a/core/state/statedb.go b/core/state/statedb.go index 1c4af0295..3742c178b 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -34,10 +34,6 @@ import ( lru "github.com/hashicorp/golang-lru" ) -// The starting nonce determines the default nonce when new accounts are being -// created. -var StartingNonce uint64 - // Trie cache generation limit after which to evic trie nodes from memory. var MaxTrieCacheGen = uint16(120) @@ -239,7 +235,7 @@ func (self *StateDB) GetNonce(addr common.Address) uint64 { return stateObject.Nonce() } - return StartingNonce + return 0 } func (self *StateDB) GetCode(addr common.Address) []byte { @@ -423,7 +419,7 @@ func (self *StateDB) MarkStateObjectDirty(addr common.Address) { func (self *StateDB) createObject(addr common.Address) (newobj, prev *StateObject) { prev = self.GetStateObject(addr) newobj = newObject(self, addr, Account{}, self.MarkStateObjectDirty) - newobj.setNonce(StartingNonce) // sets the object to dirty + newobj.setNonce(0) // sets the object to dirty if prev == nil { if glog.V(logger.Core) { glog.Infof("(+) %x\n", addr) |