Skip to content

Commit

Permalink
Cleanup Minor Bugs in FastHotStuffConsensus (#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
tholonious authored Jan 26, 2024
1 parent 1c0eefe commit 4083d42
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/pos_consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func NewFastHotStuffConsensus(params *DeSoParams, blockchain *Blockchain, mempoo
blockchain: blockchain,
fastHotStuffEventLoop: consensus.NewFastHotStuffEventLoop(),
mempool: mempool,
params: params,
signer: signer,
}
}
Expand Down Expand Up @@ -584,12 +585,6 @@ func (cc *FastHotStuffConsensus) produceUnsignedBlockForBlockProposalEvent(
event *consensus.FastHotStuffEvent,
proposerRandomSeedSignature *bls.Signature,
) (*MsgDeSoBlock, error) {
// We need to hold a lock on the blockchain to make sure that it is not mutated underneath as we are trying
// to construct a block based on the UtxoView. In practice, this lock ends up being a no-op but it guarantees
// thread-safety by making no assumptions about how other parts of the codebase operate outside of this struct.
cc.blockchain.ChainLock.RLock()
defer cc.blockchain.ChainLock.RUnlock()

// Get the parent block's hash
parentBlockHash := BlockHashFromConsensusInterface(event.QC.GetBlockHash())

Expand Down

0 comments on commit 4083d42

Please sign in to comment.