core: added CheckNonce() to Message interface

This commit is contained in:
zsfelfoldi
2016-07-11 11:58:10 +02:00
parent 2b94d7fc7f
commit 00787fe781
7 changed files with 17 additions and 8 deletions

View File

@ -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