diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-25 18:35:25 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:17 +0800 |
commit | 1d3949f4a7d0e03badcfb682dbba99608b41e1c9 (patch) | |
tree | 77a89679f267e2888c4f2bdefc590fed36646417 /dex/app.go | |
parent | 218edbb4b4116b6f5e5707c5c89b8a346f47300d (diff) | |
download | go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar.gz go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar.bz2 go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar.lz go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar.xz go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.tar.zst go-tangerine-1d3949f4a7d0e03badcfb682dbba99608b41e1c9.zip |
dex: remove uneeded info from block header
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 20 |
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) |