diff --git a/chain/bitcoind_client.go b/chain/bitcoind_client.go index 742c8863e6..b69e7d34df 100644 --- a/chain/bitcoind_client.go +++ b/chain/bitcoind_client.go @@ -962,6 +962,9 @@ func (c *BitcoindClient) rescan(start chainhash.Hash) error { } headers.PushBack(previousHeader) + log.Debugf("Rescanning from block height %v to %v", + previousHeader.Height+1, bestBlock.Height) + // Cycle through all of the blocks known to bitcoind, being mindful of // reorgs. for i := previousHeader.Height + 1; i <= bestBlock.Height; i++ { diff --git a/go.mod b/go.mod index 7f4e600203..cdc3353024 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 github.com/btcsuite/btcwallet/walletdb v1.5.1 - github.com/btcsuite/btcwallet/wtxmgr v1.5.5 + github.com/btcsuite/btcwallet/wtxmgr v1.5.6 github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 diff --git a/go.sum b/go.sum index 9b52280ac1..53a514aa4b 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 h1:93o5Xz9dYepBP4RMFUc9RGIFX github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5/go.mod h1:lQ+e9HxZ85QP7r3kdxItkiMSloSLg1PEGis5o5CXUQw= github.com/btcsuite/btcwallet/walletdb v1.5.1 h1:HgMhDNCrtEFPC+8q0ei5DQ5U9Tl4RCspA22DEKXlopI= github.com/btcsuite/btcwallet/walletdb v1.5.1/go.mod h1:jk/hvpLFINF0C1kfTn0bfx2GbnFT+Nvnj6eblZALfjs= -github.com/btcsuite/btcwallet/wtxmgr v1.5.5 h1:VA/rHzAjiNuySPcKgdX3uAywbVczZlG5OZeSU7jYoZo= -github.com/btcsuite/btcwallet/wtxmgr v1.5.5/go.mod h1:lzVbDkk/jRao2ib5kge46aLZW1yFc8RFNycdYpnsmZA= +github.com/btcsuite/btcwallet/wtxmgr v1.5.6 h1:Zwvr/rrJYdOLqdBCSr4eICEstnEA+NBUvjIWLkrXaYI= +github.com/btcsuite/btcwallet/wtxmgr v1.5.6/go.mod h1:lzVbDkk/jRao2ib5kge46aLZW1yFc8RFNycdYpnsmZA= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -131,8 +131,6 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/ziggie1984/btcwallet/wtxmgr v1.5.1-0.20250409134448-0a7b1137338f h1:iDexQIPkv+0lIHlFBdEjJQ7FhSV59q2Iy/BcFzQ8j1g= -github.com/ziggie1984/btcwallet/wtxmgr v1.5.1-0.20250409134448-0a7b1137338f/go.mod h1:lzVbDkk/jRao2ib5kge46aLZW1yFc8RFNycdYpnsmZA= go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/wallet/rescan.go b/wallet/rescan.go index 01bdadc4ee..4f26646c2b 100644 --- a/wallet/rescan.go +++ b/wallet/rescan.go @@ -250,15 +250,17 @@ out: case batch := <-w.rescanBatch: // Log the newly-started rescan. numAddrs := len(batch.addrs) - noun := pickNoun(numAddrs, "address", "addresses") - log.Infof("Started rescan from block %v (height %d) for %d %s", - batch.bs.Hash, batch.bs.Height, numAddrs, noun) + numOps := len(batch.outpoints) + + log.Infof("Started rescan from block %v (height %d) "+ + "for %d addrs, %d outpoints", batch.bs.Hash, + batch.bs.Height, numAddrs, numOps) err := chainClient.Rescan(&batch.bs.Hash, batch.addrs, batch.outpoints) if err != nil { - log.Errorf("Rescan for %d %s failed: %v", numAddrs, - noun, err) + log.Errorf("Rescan for %d addrs, %d outpoints "+ + "failed: %v", numAddrs, numOps, err) } batch.done(err) case <-quit: diff --git a/wallet/wallet.go b/wallet/wallet.go index b1a28a0b7a..e7e2058d50 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -382,7 +382,7 @@ func (w *Wallet) activeData(dbtx walletdb.ReadWriteTx) ([]btcutil.Address, []wtx return nil, nil, err } - unspent, err := w.TxStore.UnspentOutputs(txmgrNs) + unspent, err := w.TxStore.OutputsToWatch(txmgrNs) return addrs, unspent, err }