aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go6
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 {