diff options
author | bojie <bojie@dexon.org> | 2019-03-11 17:43:52 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 390b0f5aa6d7a5127a04b8949815033d59608e7b (patch) | |
tree | 240c9999c6b84028645bdd83891da10708fe8499 /dex/app.go | |
parent | 2af2607585ee7145fe49d8ab4eba400dddad942d (diff) | |
download | dexon-390b0f5aa6d7a5127a04b8949815033d59608e7b.tar.gz dexon-390b0f5aa6d7a5127a04b8949815033d59608e7b.tar.zst dexon-390b0f5aa6d7a5127a04b8949815033d59608e7b.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 { |