Use log.Errorf for error messages with params.

This commit is contained in:
Dave Collins 2013-09-09 10:59:31 -05:00
parent cf7438a646
commit afddca6870
2 changed files with 4 additions and 3 deletions

View file

@ -94,7 +94,7 @@ func (b *blockManager) startSync(peers *list.List) {
if bestPeer != nil { if bestPeer != nil {
locator, err := b.blockChain.LatestBlockLocator() locator, err := b.blockChain.LatestBlockLocator()
if err != nil { if err != nil {
log.Error("[BMGR] Failed to get block locator for the "+ log.Errorf("[BMGR] Failed to get block locator for the "+
"latest block: %v", err) "latest block: %v", err)
return return
} }
@ -269,12 +269,13 @@ out:
// connected to and disconnected from the main chain. // connected to and disconnected from the main chain.
func (b *blockManager) handleNotifyMsg(notification *btcchain.Notification) { func (b *blockManager) handleNotifyMsg(notification *btcchain.Notification) {
switch notification.Type { switch notification.Type {
// An orphan block has been accepted by the block chain.
case btcchain.NTOrphanBlock: case btcchain.NTOrphanBlock:
orphanRoot := notification.Data.(*btcwire.ShaHash) orphanRoot := notification.Data.(*btcwire.ShaHash)
if peer, exists := b.blockPeer[*orphanRoot]; exists { if peer, exists := b.blockPeer[*orphanRoot]; exists {
locator, err := b.blockChain.LatestBlockLocator() locator, err := b.blockChain.LatestBlockLocator()
if err != nil { if err != nil {
log.Error("[BMGR] Failed to get block locator "+ log.Errorf("[BMGR] Failed to get block locator "+
"for the latest block: %v", err) "for the latest block: %v", err)
break break
} }

View file

@ -352,7 +352,7 @@ func (p *peer) handleInvMsg(msg *btcwire.MsgInv) {
orphanRoot := chain.GetOrphanRoot(&iv.Hash) orphanRoot := chain.GetOrphanRoot(&iv.Hash)
locator, err := chain.LatestBlockLocator() locator, err := chain.LatestBlockLocator()
if err != nil { if err != nil {
log.Error("[PEER] Failed to get block "+ log.Errorf("[PEER] Failed to get block "+
"locator for the latest block: "+ "locator for the latest block: "+
"%v", err) "%v", err)
continue continue