From 231670b30eb9f62f93ab2680d258413b50ec3c75 Mon Sep 17 00:00:00 2001 From: Ryan Staudt Date: Thu, 15 Oct 2020 21:03:12 -0500 Subject: [PATCH] mining: Add method comments to blockManagerFacade. --- blockmanager.go | 7 ++++--- internal/mining/interface.go | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/blockmanager.go b/blockmanager.go index a9a226c4eb..2927c5bbef 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -2429,9 +2429,10 @@ func (b *blockManager) CalcNextRequiredStakeDifficulty() (int64, error) { return response.stakeDifficulty, response.err } -// ForceReorganization returns the hashes of all the children of a parent for the -// block hash that is passed to the function. It is funneled through the block -// manager since blockchain is not safe for concurrent access. +// ForceReorganization forces a reorganization of the block chain to the block +// hash requested, so long as it matches up with the current organization of the +// best chain. It is funneled through the block manager since blockchain is not +// safe for concurrent access. func (b *blockManager) ForceReorganization(formerBest, newBest chainhash.Hash) error { reply := make(chan forceReorganizationResponse) b.msgChan <- forceReorganizationMsg{ diff --git a/internal/mining/interface.go b/internal/mining/interface.go index 3bfac0feda..70ffcaddd5 100644 --- a/internal/mining/interface.go +++ b/internal/mining/interface.go @@ -110,7 +110,16 @@ type TxSource interface { // blockManagerFacade provides the mining package with a subset of // the methods originally defined in the blockManager. type blockManagerFacade interface { + // ForceReorganization forces a reorganization of the block chain to the block + // hash requested, so long as it matches up with the current organization of the + // best chain. ForceReorganization(formerBest, newBest chainhash.Hash) error + + // IsCurrent returns whether or not the block manager believes it is synced + // with the connected peers. IsCurrent() bool + + // NotifyWork passes new mining work to the notification manager for block + // notification processing. NotifyWork(templateNtfn *TemplateNtfn) }