diff options
author | BJ4 <bojie@dexon.org> | 2018-11-15 16:02:19 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 2bb4c1bfc76895cd8e8ef095523fe0932ade7098 (patch) | |
tree | c1a4c128e7211c16cc2979c9c3108baedf766301 /dex | |
parent | 8150597b3878368ad090c9846cdf50dd812b2181 (diff) | |
download | dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar.gz dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar.bz2 dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar.lz dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar.xz dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.tar.zst dexon-2bb4c1bfc76895cd8e8ef095523fe0932ade7098.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 { |