Skip to content

Commit

Permalink
mining: Add method comments to blockManagerFacade.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaudt2 authored and davecgh committed Oct 16, 2020
1 parent 0ea393c commit 231670b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blockmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
9 changes: 9 additions & 0 deletions internal/mining/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 231670b

Please sign in to comment.