aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorBJ4 <bojie@dexon.org>2018-11-15 16:02:19 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:49:57 +0800
commit97ff98acf5d92cf6a20cad0abe68be0d1f135742 (patch)
tree80af50f7cb982f69c88cf59f58a84a83c67fe849 /dex
parenta31f09d410d270843144c9accc92251e79f45d1d (diff)
downloaddexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar.gz
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar.bz2
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar.lz
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar.xz
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.tar.zst
dexon-97ff98acf5d92cf6a20cad0abe68be0d1f135742.zip
app: add cache to reuse same tx address which has already recovered (#26)
Diffstat (limited to 'dex')
-rw-r--r--dex/app.go11
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 {