Misc cleanup.

This commit is contained in:
Dave Collins 2013-10-07 19:24:44 -05:00
parent 19d28f90e6
commit 1d2c48555b
3 changed files with 3 additions and 12 deletions

View file

@ -490,9 +490,6 @@ 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
}

View file

@ -113,8 +113,7 @@ func btcdMain() error {
}
// Perform upgrades to btcd as new versions require it.
err = doUpgrades()
if err != nil {
if err := doUpgrades(); err != nil {
log.Errorf("%v", err)
return err
}
@ -151,14 +150,12 @@ func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
// Up some limits.
err := setLimits()
if err != nil {
if err := setLimits(); err != nil {
os.Exit(1)
}
// Work around defer not working after os.Exit()
err = btcdMain()
if err != nil {
if err := btcdMain(); err != nil {
os.Exit(1)
}
}

View file

@ -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
// 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. 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.
for e := peers.Front(); e != nil; e = e.Next() {