aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorWei-Ning Huang <aitjcize@gmail.com>2018-11-13 15:26:21 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commitaec90eae15b9ad106e3443fc5c5ab6f285e131a0 (patch)
tree0e94fd18c8f3667d36a5b29587c98e1d105968aa /dex/app.go
parent74111db752635adcfe39cb309b8335aa50a1e90a (diff)
downloadgo-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar.gz
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar.bz2
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar.lz
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar.xz
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.tar.zst
go-tangerine-aec90eae15b9ad106e3443fc5c5ab6f285e131a0.zip
dex: return correct pending nonce (#14)
We need to return the correct pending nonce (include those in the tx pool). Also, StateAndHeaderByNumber is also fixed to use pending block.
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/dex/app.go b/dex/app.go
index d0d911e86..a90dfae37 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -275,13 +275,13 @@ addressMap:
// PrepareWitness will return the witness data no lower than consensusHeight.
func (d *DexconApp) PrepareWitness(consensusHeight uint64) (witness coreTypes.Witness, err error) {
var witnessBlock *types.Block
- lastPendingHeight := d.blockchain.GetLastPendingHeight()
+ lastPendingHeight := d.blockchain.GetPendingHeight()
if lastPendingHeight == 0 && consensusHeight == 0 {
witnessBlock = d.blockchain.CurrentBlock()
} else if lastPendingHeight >= consensusHeight {
- witnessBlock = d.blockchain.GetLastPendingBlock()
+ witnessBlock = d.blockchain.GetPendingBlock()
} else if h := <-d.addNotify(consensusHeight); h >= consensusHeight {
- witnessBlock = d.blockchain.GetLastPendingBlock()
+ witnessBlock = d.blockchain.GetPendingBlock()
} else {
log.Error("need pending block")
return witness, fmt.Errorf("need pending block")