Skip to content

Commit

Permalink
Unexport wallet SaveRescanned method
Browse files Browse the repository at this point in the history
This is only called by (*Wallet).rescan; there's no need for it to be
called from outside the wallet package.
  • Loading branch information
jrick committed Mar 20, 2023
1 parent 0aeb02c commit dc38eb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wallet/rescan.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ func (f *RescanFilter) RemoveUnspentOutPoint(op *wire.OutPoint) {
delete(f.unspent, *op)
}

// SaveRescanned records transactions from a rescanned block. This
// saveRescanned records transactions from a rescanned block. This
// does not update the network backend with data to watch for future
// relevant transactions as the rescanner is assumed to handle this
// task.
func (w *Wallet) SaveRescanned(ctx context.Context, hash *chainhash.Hash, txs []*wire.MsgTx) error {
const op errors.Op = "wallet.SaveRescanned"
func (w *Wallet) saveRescanned(ctx context.Context, hash *chainhash.Hash, txs []*wire.MsgTx) error {
const op errors.Op = "wallet.saveRescanned"

defer w.lockedOutpointMu.Unlock()
w.lockedOutpointMu.Lock()
Expand All @@ -174,7 +174,7 @@ func (w *Wallet) SaveRescanned(ctx context.Context, hash *chainhash.Hash, txs []
if err != nil {
return err
}
_, err = w.processTransactionRecord(ctx, dbtx, rec, header, &blockMeta)
_, err = w.processTransactionRecord(context.Background(), dbtx, rec, header, &blockMeta)
if err != nil {
return err
}
Expand Down Expand Up @@ -230,7 +230,7 @@ func (w *Wallet) rescan(ctx context.Context, n NetworkBackend,
}
log.Infof("Rescanning block range [%v, %v]...", height, through)
saveRescanned := func(block *chainhash.Hash, txs []*wire.MsgTx) error {
return w.SaveRescanned(ctx, block, txs)
return w.saveRescanned(ctx, block, txs)
}
err = n.Rescan(ctx, rescanBlocks, saveRescanned)
if err != nil {
Expand Down

0 comments on commit dc38eb6

Please sign in to comment.