documentation: update consensus interface doc

This commit is contained in:
Robert Zaremba 2020-05-03 17:42:38 +02:00
parent ca22d0761b
commit 8b72a9d02d
2 changed files with 5 additions and 2 deletions

View file

@ -137,8 +137,9 @@ var (
errRecentlySigned = errors.New("recently signed") errRecentlySigned = errors.New("recently signed")
) )
// SignerFn is a signer callback function to request a header to be signed by a // SignerFn hashes and signs the data to be signed by a backing account. It should point to the
// backing account. // accounts.Wallet.SignData method.
// The function arguments are: current address, mimeType and data to be hashed and signed.
type SignerFn func(accounts.Account, string, []byte) ([]byte, error) type SignerFn func(accounts.Account, string, []byte) ([]byte, error)
// ecrecover extracts the Ethereum account address from a signed header. // ecrecover extracts the Ethereum account address from a signed header.

View file

@ -100,6 +100,8 @@ type Engine interface {
// //
// Note, the method returns immediately and will send the result async. More // Note, the method returns immediately and will send the result async. More
// than one result may also be returned depending on the consensus algorithm. // than one result may also be returned depending on the consensus algorithm.
// Stop is triggered by closing the @stop channel hence, any receive from
// @stop will succeed without blocking.
Seal(chain ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error Seal(chain ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error
// SealHash returns the hash of a block prior to it being sealed. // SealHash returns the hash of a block prior to it being sealed.