diff options
author | BJ4 <bojie@dexon.org> | 2018-11-15 16:02:19 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:53 +0800 |
commit | 24e161879e478a589c8857a1b2fec66fa948d225 (patch) | |
tree | af407d2615b41ff4703cfa91f86708f6aced2ae7 /dex | |
parent | b26e4c9adaa2952a63bf811f991a3e6fb9fc5646 (diff) | |
download | dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar.gz dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar.bz2 dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar.lz dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar.xz dexon-24e161879e478a589c8857a1b2fec66fa948d225.tar.zst dexon-24e161879e478a589c8857a1b2fec66fa948d225.zip |
app: add cache to reuse same tx address which has already recovered (#26)
Diffstat (limited to 'dex')
-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 { |