Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions chain/btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,21 +280,14 @@ func (c *RPCClient) IsCurrent() bool {
return bestHeader.Timestamp.After(time.Now().Add(-isCurrentDelta))
}

// Rescan wraps the normal Rescan command with an additional parameter that
// allows us to map an outpoint to the address in the chain that it pays to.
// This is useful when using BIP 158 filters as they include the prev pkScript
// rather than the full outpoint.
// Rescan rescans from the block with the given hash through the best block for
// the passed addresses and outpoints, and then watches them for subsequent
// notifications. The rescan is performed on the client with loadtxfilter,
// getheaders and rescanblocks, in place of the deprecated rescan command.
func (c *RPCClient) Rescan(startHash *chainhash.Hash, addrs []address.Address,
outPoints map[wire.OutPoint]address.Address) error {

flatOutpoints := make([]*wire.OutPoint, 0, len(outPoints))
for ops := range outPoints {
ops := ops

flatOutpoints = append(flatOutpoints, &ops)
}

return c.Client.Rescan(startHash, addrs, flatOutpoints) // nolint:staticcheck
return c.rescan(c.Client, startHash, addrs, outPoints)
}

// WaitForShutdown blocks until both the client has finished disconnecting
Expand Down
Loading