(Still missing some documentation, examples and copyright notice on the package.)
This introduces a new package called chainscan. The primary goal for this package is to be able to perform historical and tip-changed-triggered scans of blocks to determine whether they have relevant transactions for the LN node and retrieve the ones that are.
This is an improvement over the existing manual rescan performed by the the dcrd node via LoadTxFilter as done today in dcrlnd in that it checks the cfilters for the wanted targets before attempting to iterate over the block's transactions.
It is also a necessary step towards supporting SPV mode, given that in that mode the LN node does not have access to a full chain.
The package is self-contained and has minimal external dependencies. The implemented scanners (Historical and TipWatcher) require that the caller provide implementations for the chain operations necessary for the search to happen, so this package is usable by callers retrieving their information from a running dcrd instance, a dcrwallet instance or from some other source of blockchain data. This makes it suitable for use by software other than dcrlnd.
Part of #80
(Still missing some documentation, examples and copyright notice on the package.)
This introduces a new package called
chainscan
. The primary goal for this package is to be able to perform historical and tip-changed-triggered scans of blocks to determine whether they have relevant transactions for the LN node and retrieve the ones that are.This is an improvement over the existing manual rescan performed by the the dcrd node via LoadTxFilter as done today in dcrlnd in that it checks the cfilters for the wanted targets before attempting to iterate over the block's transactions.
It is also a necessary step towards supporting SPV mode, given that in that mode the LN node does not have access to a full chain.
The package is self-contained and has minimal external dependencies. The implemented scanners (
Historical
andTipWatcher
) require that the caller provide implementations for the chain operations necessary for the search to happen, so this package is usable by callers retrieving their information from a running dcrd instance, a dcrwallet instance or from some other source of blockchain data. This makes it suitable for use by software other than dcrlnd.A set of tests and benchmarks is included.