diff options
author | BJ4 <bojie@dexon.org> | 2018-11-15 16:02:19 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | d945ea451bece3c8e230ae017dd443266633d634 (patch) | |
tree | 1f5f47f05639d42e836f47eaccaa90773261db7d /dex/app.go | |
parent | dbb3d8fd30bd33df37f13048dc334ead8d335ddc (diff) | |
download | go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar.gz go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar.bz2 go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar.lz go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar.xz go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.tar.zst go-tangerine-d945ea451bece3c8e230ae017dd443266633d634.zip |
app: add cache to reuse same tx address which has already recovered (#26)
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/dex/app.go b/dex/app.go index af8295c9a..38ca382e3 100644 --- a/dex/app.go +++ b/dex/app.go @@ -458,18 +458,11 @@ func (d *DexconApp) BlockDelivered( d.chainLock(chainID) defer d.chainUnlock(chainID) - block := d.blockchain.GetConfirmedBlockByHash(chainID, blockHash) + block, txs := d.blockchain.GetConfirmedBlockByHash(chainID, blockHash) if block == nil { panic("Can not get confirmed block") } - var transactions types.Transactions - err := rlp.DecodeBytes(block.Payload, &transactions) - if err != nil { - log.Error("Payload rlp decode failed", "error", err) - panic(err) - } - block.Payload = nil dexconMeta, err := rlp.EncodeToBytes(block) if err != nil { @@ -485,7 +478,7 @@ func (d *DexconApp) BlockDelivered( Round: block.Position.Round, DexconMeta: dexconMeta, Randomness: result.Randomness, - }, transactions, nil, nil) + }, txs, nil, nil) root, err := d.blockchain.ProcessPendingBlock(newBlock, &block.Witness) if err != nil { |