From 8b72a9d02dd2ca331794d3fd85fb02adcb9f5f80 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sun, 3 May 2020 17:42:38 +0200 Subject: [PATCH] documentation: update consensus interface doc --- consensus/clique/clique.go | 5 +++-- consensus/consensus.go | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 100c205292..cf7e7d7c83 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -137,8 +137,9 @@ var ( errRecentlySigned = errors.New("recently signed") ) -// SignerFn is a signer callback function to request a header to be signed by a -// backing account. +// SignerFn hashes and signs the data to be signed by a backing account. It should point to the +// 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) // ecrecover extracts the Ethereum account address from a signed header. diff --git a/consensus/consensus.go b/consensus/consensus.go index f753af550c..b8848979c2 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -100,6 +100,8 @@ type Engine interface { // // Note, the method returns immediately and will send the result async. More // 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 // SealHash returns the hash of a block prior to it being sealed.