aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-25 18:35:25 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:52 +0800
commita0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1 (patch)
tree302bd80de1d32f587f03ecfbc9f99b3dffbefa8d /dex/app.go
parentc15f524e4a4bc22dfca78777bfc4ae4cf76b8933 (diff)
downloaddexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar.gz
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar.bz2
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar.lz
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar.xz
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.tar.zst
dexon-a0b4489cb5f206acdbb130aca18ff2dcb6cfe0d1.zip
dex: remove uneeded info from block header
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go20
1 files changed, 5 insertions, 15 deletions
diff --git a/dex/app.go b/dex/app.go
index b1558b46f..5193fdfb8 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -464,13 +464,6 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
panic(err)
}
- var witnessData witnessData
- err = rlp.Decode(bytes.NewReader(block.Witness.Data), &witnessData)
- if err != nil {
- log.Error("Witness rlp decode failed", "error", err)
- panic(err)
- }
-
block.Payload = nil
dexconMeta, err := rlp.EncodeToBytes(block)
if err != nil {
@@ -478,21 +471,18 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
}
newBlock := types.NewBlock(&types.Header{
- Number: new(big.Int).SetUint64(result.Height),
- Time: big.NewInt(result.Timestamp.Unix()),
- Coinbase: common.BytesToAddress(block.ProposerID.Bytes()),
- Position: block.Position,
- WitnessHeight: block.Witness.Height,
- WitnessRoot: witnessData.Root,
- WitnessReceiptHash: witnessData.ReceiptHash,
+ Number: new(big.Int).SetUint64(result.Height),
+ Time: big.NewInt(result.Timestamp.Unix()),
+ Coinbase: common.BytesToAddress(block.ProposerID.Bytes()),
// TODO(bojie): fix it
GasLimit: 8000000,
Difficulty: big.NewInt(1),
+ Round: block.Position.Round,
DexconMeta: dexconMeta,
Randomness: result.Randomness,
}, transactions, nil, nil)
- _, err = d.blockchain.ProcessPendingBlock(newBlock)
+ _, err = d.blockchain.ProcessPendingBlock(newBlock, &block.Witness)
if err != nil {
log.Error("Insert chain", "error", err)
panic(err)