diff options
author | zsfelfoldi <zsfelfoldi@gmail.com> | 2016-07-11 17:58:10 +0800 |
---|---|---|
committer | zsfelfoldi <zsfelfoldi@gmail.com> | 2016-07-11 18:35:23 +0800 |
commit | 00787fe7818b7baaa95ef7928b5101df2d052dce (patch) | |
tree | ac4322a7634a9981815098cc91440d6a9156f329 /core/state_transition.go | |
parent | 2b94d7fc7fa93ecfd5ab6ddaa0c7bf4d2224d2be (diff) | |
download | dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar.gz dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar.bz2 dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar.lz dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar.xz dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.tar.zst dexon-00787fe7818b7baaa95ef7928b5101df2d052dce.zip |
core: added CheckNonce() to Message interface
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/state_transition.go b/core/state_transition.go index c8160424b..9e6b2f567 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -71,6 +71,7 @@ type Message interface { Value() *big.Int Nonce() uint64 + CheckNonce() bool Data() []byte } @@ -208,8 +209,10 @@ func (self *StateTransition) preCheck() (err error) { } // Make sure this transaction's nonce is correct - if n := self.state.GetNonce(sender.Address()); n != msg.Nonce() { - return NonceError(msg.Nonce(), n) + if msg.CheckNonce() { + if n := self.state.GetNonce(sender.Address()); n != msg.Nonce() { + return NonceError(msg.Nonce(), n) + } } // Pre-pay gas |