aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-08-27 06:03:59 +0800
committerFelix Lange <fjl@twurst.com>2015-08-27 06:03:59 +0800
commit6ec13e7e2bab1ebdb580819a48629055bbbb5fb3 (patch)
treecd23c3deac1a41b34a5157c1f7c5361ca56b4137 /core
parent79b644c7a35bbc835b7e78ddf8a31c37e69b0784 (diff)
parent17f65cd1e5e0fea6e4f7b96c60767aaa0ada366d (diff)
downloaddexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar.gz
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar.bz2
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar.lz
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar.xz
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.tar.zst
dexon-6ec13e7e2bab1ebdb580819a48629055bbbb5fb3.zip
Merge pull request #1701 from karalabe/eth62-sync-rebase
eth: implement eth/62 synchronization logic
Diffstat (limited to 'core')
-rw-r--r--core/types/block.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 2188e6d4d..fd81db04c 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -360,6 +360,20 @@ func (b *Block) WithMiningResult(nonce uint64, mixDigest common.Hash) *Block {
}
}
+// WithBody returns a new block with the given transaction and uncle contents.
+func (b *Block) WithBody(transactions []*Transaction, uncles []*Header) *Block {
+ block := &Block{
+ header: copyHeader(b.header),
+ transactions: make([]*Transaction, len(transactions)),
+ uncles: make([]*Header, len(uncles)),
+ }
+ copy(block.transactions, transactions)
+ for i := range uncles {
+ block.uncles[i] = copyHeader(uncles[i])
+ }
+ return block
+}
+
// Implement pow.Block
func (b *Block) Hash() common.Hash {