Misc cleanup.
This commit is contained in:
parent
19d28f90e6
commit
1d2c48555b
3 changed files with 3 additions and 12 deletions
|
@ -490,9 +490,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
9
btcd.go
9
btcd.go
|
@ -113,8 +113,7 @@ func btcdMain() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform upgrades to btcd as new versions require it.
|
// Perform upgrades to btcd as new versions require it.
|
||||||
err = doUpgrades()
|
if err := doUpgrades(); err != nil {
|
||||||
if err != nil {
|
|
||||||
log.Errorf("%v", err)
|
log.Errorf("%v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -151,14 +150,12 @@ func main() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|
||||||
// Up some limits.
|
// Up some limits.
|
||||||
err := setLimits()
|
if err := setLimits(); err != nil {
|
||||||
if err != nil {
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work around defer not working after os.Exit()
|
// Work around defer not working after os.Exit()
|
||||||
err = btcdMain()
|
if err := btcdMain(); err != nil {
|
||||||
if err != nil {
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,9 +162,6 @@ func (s *server) handleBanPeerMsg(banned map[string]time.Time, p *peer) {
|
||||||
// handleRelayInvMsg deals with relaying inventory to peers that are not already
|
// handleRelayInvMsg deals with relaying inventory to peers that are not already
|
||||||
// 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
|
|
||||||
// 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.
|
||||||
for e := peers.Front(); e != nil; e = e.Next() {
|
for e := peers.Front(); e != nil; e = e.Next() {
|
||||||
|
|
Loading…
Reference in a new issue