From 7e6fbc77b8be3f2f0cc52f410b071a1e1fd28641 Mon Sep 17 00:00:00 2001 From: bojie Date: Mon, 11 Mar 2019 17:43:52 +0800 Subject: app: new app test flow (#244) --- dex/app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dex/app.go') 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 { -- cgit v1.2.3