aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-03-11 17:43:52 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:22 +0800
commit8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461 (patch)
tree3c54d34e573b97ed4120a33bc5d6593e618a9d49 /dex/app.go
parent04cb64b849988c1cf71fd66a3142f01e8ba7cb23 (diff)
downloadgo-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.gz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.bz2
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.lz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.xz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.zst
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.zip
app: new app test flow (#244)
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 {