chainreg: Add BestBlockTracker to ChainControl

This commit takes the best block tracker and adds it to the
ChainControl objects and appropriately initializes it on
ChainControl creation
This commit is contained in:
Keagan McClelland 2023-07-12 16:28:26 -06:00
parent 405d4e5f73
commit 7c403b439c

View File

@ -145,6 +145,10 @@ type PartialChainControl struct {
// interested in.
ChainNotifier chainntnfs.ChainNotifier
// BestBlockTracker is used to maintain a view of the global
// chain state that changes over time
BestBlockTracker *chainntnfs.BestBlockTracker
// MempoolNotifier is used to watch for spending events happened in
// mempool.
MempoolNotifier chainntnfs.MempoolWatcher
@ -667,6 +671,9 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
cfg.Bitcoin.Node)
}
cc.BestBlockTracker =
chainntnfs.NewBestBlockTracker(cc.ChainNotifier)
switch {
// If the fee URL isn't set, and the user is running mainnet, then
// we'll return an error to instruct them to set a proper fee