Update a few comments.
This commit is contained in:
parent
78e9b94d93
commit
47c07ee5e1
2 changed files with 8 additions and 9 deletions
|
@ -413,13 +413,10 @@ func (b *blockManager) handleInvMsg(imsg *invMsg) {
|
|||
|
||||
// blockHandler is the main handler for the block manager. It must be run
|
||||
// as a goroutine. It processes block and inv messages in a separate goroutine
|
||||
// from the peer handlers so the block (MsgBlock) and tx (MsgTx) messages are
|
||||
// handled by a single thread without needing to lock memory data structures.
|
||||
// This is important because the block manager controls which blocks are needed
|
||||
// and how the fetching should proceed.
|
||||
//
|
||||
// NOTE: Tx messages need to be handled here too.
|
||||
// (either that or block and tx need to be handled in separate threads)
|
||||
// from the peer handlers so the block (MsgBlock) messages are handled by a
|
||||
// single thread without needing to lock memory data structures. This is
|
||||
// important because the block manager controls which blocks are needed and how
|
||||
// the fetching should proceed.
|
||||
func (b *blockManager) blockHandler() {
|
||||
candidatePeers := list.New()
|
||||
out:
|
||||
|
@ -480,7 +477,9 @@ func (b *blockManager) handleNotifyMsg(notification *btcchain.Notification) {
|
|||
case btcchain.NTBlockAccepted:
|
||||
// Don't relay if we are not current. Other peers that are
|
||||
// current should already know about it.
|
||||
|
||||
// TODO(davec): This should really be over in RelayInventory
|
||||
// in server to stop all relays, but chain is not concurrent
|
||||
// safe at this time, so call it here to single thread access.
|
||||
if !b.blockChain.IsCurrent() {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ func (s *server) handleBanPeerMsg(banned map[string]time.Time, p *peer) {
|
|||
// known to have it. It is invoked from the peerHandler goroutine.
|
||||
func (s *server) handleRelayInvMsg(peers *list.List, iv *btcwire.InvVect) {
|
||||
// TODO(davec): Don't relay inventory during the initial block chain
|
||||
// download.
|
||||
// download. Move the check out of the block manager.
|
||||
|
||||
// Loop through all connected peers and relay the inventory to those
|
||||
// which are not already known to have it.
|
||||
|
|
Loading…
Reference in a new issue