aboutsummaryrefslogtreecommitdiff
path: root/consensus/dummy
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-08-14 01:37:25 -0400
committerDeterminant <[email protected]>2019-08-14 01:37:25 -0400
commit592f21f5b97e5b1e714f194ae90ab83e6547cf41 (patch)
treec500cdf4ca4266af15703eca182df34d66715918 /consensus/dummy
parentad886faec521f1edcb90f6f8eb4555608d085312 (diff)
finish a full chain example (with p2p network)
Diffstat (limited to 'consensus/dummy')
-rw-r--r--consensus/dummy/consensus.go7
1 files changed, 3 insertions, 4 deletions
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 {