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
|
// 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
|
// 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
|
// from the peer handlers so the block (MsgBlock) messages are handled by a
|
||||||
// handled by a single thread without needing to lock memory data structures.
|
// single thread without needing to lock memory data structures. This is
|
||||||
// This is important because the block manager controls which blocks are needed
|
// important because the block manager controls which blocks are needed and how
|
||||||
// and how the fetching should proceed.
|
// 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)
|
|
||||||
func (b *blockManager) blockHandler() {
|
func (b *blockManager) blockHandler() {
|
||||||
candidatePeers := list.New()
|
candidatePeers := list.New()
|
||||||
out:
|
out:
|
||||||
|
@ -480,7 +477,9 @@ func (b *blockManager) handleNotifyMsg(notification *btcchain.Notification) {
|
||||||
case btcchain.NTBlockAccepted:
|
case btcchain.NTBlockAccepted:
|
||||||
// Don't relay if we are not current. Other peers that are
|
// Don't relay if we are not current. Other peers that are
|
||||||
// current should already know about it.
|
// 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() {
|
if !b.blockChain.IsCurrent() {
|
||||||
return
|
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.
|
// known to have it. It is invoked from the peerHandler goroutine.
|
||||||
func (s *server) handleRelayInvMsg(peers *list.List, iv *btcwire.InvVect) {
|
func (s *server) handleRelayInvMsg(peers *list.List, iv *btcwire.InvVect) {
|
||||||
// TODO(davec): Don't relay inventory during the initial block chain
|
// 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
|
// Loop through all connected peers and relay the inventory to those
|
||||||
// which are not already known to have it.
|
// which are not already known to have it.
|
||||||
|
|
Loading…
Reference in a new issue