From bbb1ebede10cd691de4ef2fe4bf276d2fa357a31 Mon Sep 17 00:00:00 2001 From: Sonic Date: Thu, 24 Jan 2019 10:38:28 +0800 Subject: core, dex/downloader: polish headers verification and blocks insertion logic (#168) Refactor GenerateDexonChain function, move governance tx logic to the user of GenerateDexonChain (testchain_test.go) and move fake node set code to FakeDexcon. --- core/types/block.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/types') diff --git a/core/types/block.go b/core/types/block.go index 4ff34c229..88e537e3a 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -264,6 +264,17 @@ func CopyHeader(h *Header) *Header { cpy.Extra = make([]byte, len(h.Extra)) copy(cpy.Extra, h.Extra) } + if cpy.Reward = new(big.Int); h.Reward != nil { + cpy.Reward.Set(h.Reward) + } + if len(h.Randomness) > 0 { + cpy.Randomness = make([]byte, len(h.Randomness)) + copy(cpy.Randomness, h.Randomness) + } + if len(h.DexconMeta) > 0 { + cpy.DexconMeta = make([]byte, len(h.DexconMeta)) + copy(cpy.DexconMeta, h.DexconMeta) + } return &cpy } -- cgit v1.2.3