From 592f21f5b97e5b1e714f194ae90ab83e6547cf41 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 14 Aug 2019 01:37:25 -0400 Subject: finish a full chain example (with p2p network) --- consensus/dummy/consensus.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'consensus/dummy') diff --git a/consensus/dummy/consensus.go b/consensus/dummy/consensus.go index a496262..2a9441d 100644 --- a/consensus/dummy/consensus.go +++ b/consensus/dummy/consensus.go @@ -93,8 +93,7 @@ func (self *DummyEngine) verifyHeaderWorker(chain consensus.ChainReader, headers } func (self *DummyEngine) Author(header *types.Header) (common.Address, error) { - addr := common.Address{} - return addr, nil + return header.Coinbase, nil } func (self *DummyEngine) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error { @@ -173,7 +172,7 @@ func (self *DummyEngine) VerifySeal(chain consensus.ChainReader, header *types.H } func (self *DummyEngine) Prepare(chain consensus.ChainReader, header *types.Header) error { - header.Difficulty = big.NewInt(0) + header.Difficulty = big.NewInt(1) return nil } @@ -222,7 +221,7 @@ func (self *DummyEngine) SealHash(header *types.Header) (hash common.Hash) { } func (self *DummyEngine) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int { - return big.NewInt(0) + return big.NewInt(1) } func (self *DummyEngine) APIs(chain consensus.ChainReader) []rpc.API { -- cgit v1.2.3-70-g09d2