Skip to content

Commit 5b48142

Browse files
committed
chain+wallet: add more verbose logs
1 parent 5e5d895 commit 5b48142

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

chain/bitcoind_client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,9 @@ func (c *BitcoindClient) rescan(start chainhash.Hash) error {
962962
}
963963
headers.PushBack(previousHeader)
964964

965+
log.Debugf("Rescanning from block height %v to %v",
966+
previousHeader.Height+1, bestBlock.Height)
967+
965968
// Cycle through all of the blocks known to bitcoind, being mindful of
966969
// reorgs.
967970
for i := previousHeader.Height + 1; i <= bestBlock.Height; i++ {

wallet/rescan.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,17 @@ out:
250250
case batch := <-w.rescanBatch:
251251
// Log the newly-started rescan.
252252
numAddrs := len(batch.addrs)
253-
noun := pickNoun(numAddrs, "address", "addresses")
254-
log.Infof("Started rescan from block %v (height %d) for %d %s",
255-
batch.bs.Hash, batch.bs.Height, numAddrs, noun)
253+
numOps := len(batch.outpoints)
254+
255+
log.Infof("Started rescan from block %v (height %d) "+
256+
"for %d addrs, %d outpoints", batch.bs.Hash,
257+
batch.bs.Height, numAddrs, numOps)
256258

257259
err := chainClient.Rescan(&batch.bs.Hash, batch.addrs,
258260
batch.outpoints)
259261
if err != nil {
260-
log.Errorf("Rescan for %d %s failed: %v", numAddrs,
261-
noun, err)
262+
log.Errorf("Rescan for %d addrs, %d outpoints "+
263+
"failed: %v", numAddrs, numOps, err)
262264
}
263265
batch.done(err)
264266
case <-quit:

0 commit comments

Comments
 (0)