miner: refactor helper functions in worker.go (#21044)

This reduces complexity of some lengthy functions in worker.go,
making the code easier to read.
This commit is contained in:
Robert Zaremba
2020-07-28 18:16:49 +02:00
committed by GitHub
parent 28c5a8a54b
commit 37564ceda6
2 changed files with 52 additions and 41 deletions

View File

@ -137,9 +137,8 @@ var (
errRecentlySigned = errors.New("recently signed")
)
// SignerFn is a signer callback function to request a header to be signed by a
// backing account.
type SignerFn func(accounts.Account, string, []byte) ([]byte, error)
// SignerFn hashes and signs the data to be signed by a backing account.
type SignerFn func(signer accounts.Account, mimeType string, message []byte) ([]byte, error)
// ecrecover extracts the Ethereum account address from a signed header.
func ecrecover(header *types.Header, sigcache *lru.ARCCache) (common.Address, error) {