From 40a71f28cf1ada0bf6bdcdc2f3c6f31a8da134a2 Mon Sep 17 00:00:00 2001 From: gary rong Date: Thu, 23 Aug 2018 21:02:57 +0800 Subject: miner: fix state commit, track old work packages too (#17490) * miner: commit state which is relative with sealing result * consensus, core, miner, mobile: introduce sealHash interface * miner: evict pending task with threshold * miner: go fmt --- consensus/clique/clique.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'consensus/clique') diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 085944701..3730c91f6 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -673,6 +673,11 @@ func CalcDifficulty(snap *Snapshot, signer common.Address) *big.Int { return new(big.Int).Set(diffNoTurn) } +// SealHash returns the hash of a block prior to it being sealed. +func (c *Clique) SealHash(header *types.Header) common.Hash { + return sigHash(header) +} + // Close implements consensus.Engine. It's a noop for clique as there is are no background threads. func (c *Clique) Close() error { return nil -- cgit v1.2.3