From 1c68a9849d5f493ab62e18a125158f6288c1e363 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 27 Jun 2020 22:46:31 -0400 Subject: check the coinbase in ParseBlock --- coreth.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'coreth.go') diff --git a/coreth.go b/coreth.go index 06399b9..f0111d0 100644 --- a/coreth.go +++ b/coreth.go @@ -22,6 +22,13 @@ import ( "github.com/mattn/go-isatty" ) +var ( + ZeroAddr = common.Address{ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } +) + type Tx = types.Transaction type Block = types.Block type Hash = common.Hash @@ -59,10 +66,7 @@ func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Add backend, _ := eth.New(&ctx, config, cb, mcb, bcb, chainDB) chain := ÐChain{backend: backend, cb: cb, mcb: mcb, bcb: bcb} if etherBase == nil { - etherBase = &common.Address{ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - } + etherBase = &ZeroAddr } backend.SetEtherbase(*etherBase) return chain -- cgit v1.2.3-70-g09d2