aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-04-05 06:16:29 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-05 06:16:29 +0800
commit09777952ee476ff80d4b6e63b5041ff5ca0e441b (patch)
treee85320f88f548201e3476b3e7095e96fd071617b /core/types
parente50a5b77712d891ff409aa942a5cbc24e721b332 (diff)
downloadgo-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.gz
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.bz2
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.lz
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.xz
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.tar.zst
go-tangerine-09777952ee476ff80d4b6e63b5041ff5ca0e441b.zip
core, consensus: pluggable consensus engines (#3817)
This commit adds pluggable consensus engines to go-ethereum. In short, it introduces a generic consensus interface, and refactors the entire codebase to use this interface.
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/types/block.go b/core/types/block.go
index b699ba686..278594d50 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -348,12 +348,11 @@ func CalcUncleHash(uncles []*Header) common.Hash {
return rlpHash(uncles)
}
-// WithMiningResult returns a new block with the data from b
-// where nonce and mix digest are set to the provided values.
-func (b *Block) WithMiningResult(nonce BlockNonce, mixDigest common.Hash) *Block {
- cpy := *b.header
- cpy.Nonce = nonce
- cpy.MixDigest = mixDigest
+// WithSeal returns a new block with the data from b but the header replaced with
+// the sealed one.
+func (b *Block) WithSeal(header *Header) *Block {
+ cpy := *header
+
return &Block{
header: &cpy,
transactions: b.transactions,