chainntnfs/neutrinonotify: disable disconnected block ntfns while
rescanning In this commit, we modify the rescan options Neutrino uses when performing a rescan for historical chain events to disable disconnected block notifications. This is needed as the Neutrino backend will mutate its internal state while rewinding, which causes disconnected block notifications to be sent. Since the notifier acts upon these notifications, they would cause it to also rewind unnecessarily.
This commit is contained in:
parent
96a079873a
commit
2f644d9b62
@ -373,6 +373,7 @@ out:
|
|||||||
rescanUpdate := []neutrino.UpdateOption{
|
rescanUpdate := []neutrino.UpdateOption{
|
||||||
neutrino.AddAddrs(addrs...),
|
neutrino.AddAddrs(addrs...),
|
||||||
neutrino.Rewind(currentHeight),
|
neutrino.Rewind(currentHeight),
|
||||||
|
neutrino.DisableDisconnectedNtfns(true),
|
||||||
}
|
}
|
||||||
err = n.chainView.Update(rescanUpdate...)
|
err = n.chainView.Update(rescanUpdate...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -870,6 +871,7 @@ func (n *NeutrinoNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
|||||||
rescanUpdate := []neutrino.UpdateOption{
|
rescanUpdate := []neutrino.UpdateOption{
|
||||||
neutrino.AddInputs(inputToWatch),
|
neutrino.AddInputs(inputToWatch),
|
||||||
neutrino.Rewind(currentHeight),
|
neutrino.Rewind(currentHeight),
|
||||||
|
neutrino.DisableDisconnectedNtfns(true),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := n.chainView.Update(rescanUpdate...); err != nil {
|
if err := n.chainView.Update(rescanUpdate...); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user