diff options
author | bojie <bojie@dexon.org> | 2019-03-11 17:43:52 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | 7e6fbc77b8be3f2f0cc52f410b071a1e1fd28641 (patch) | |
tree | 8179e10b03d3b8638868ab75ea67fc4c517ca42b /dex/app.go | |
parent | 22325afbf6dfd179f074018fab4866a0c56a3e6a (diff) | |
download | dexon-7e6fbc77b8be3f2f0cc52f410b071a1e1fd28641.tar.gz dexon-7e6fbc77b8be3f2f0cc52f410b071a1e1fd28641.tar.zst dexon-7e6fbc77b8be3f2f0cc52f410b071a1e1fd28641.zip |
app: new app test flow (#244)
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dex/app.go b/dex/app.go index eabdf52f5..90ffd3d3c 100644 --- a/dex/app.go +++ b/dex/app.go @@ -516,7 +516,11 @@ func (d *DexconApp) addConfirmedBlock(block *coreTypes.Block) error { } // get latest nonce in block - d.addressNonce[msg.From()] = msg.Nonce() + if nonce, exist := d.addressNonce[msg.From()]; !exist || nonce < msg.Nonce() { + d.addressNonce[msg.From()] = msg.Nonce() + } else { + return fmt.Errorf("address %v nonce incorrect cached(%d) >= tx(%d)", msg.From(), nonce, msg.Nonce()) + } // calculate max cost in confirmed blocks if d.addressCost[msg.From()] == nil { |