mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-29 03:01:52 +01:00
chainntnfs: skip conf dispatch if ntfn already dispatched
This mirrors the logic for the spend case. This prevents a double dispatch scenario when combined with a later commit. Otherwise, the confirmation would linger in the buffer which is not ideal.
This commit is contained in:
parent
93d12cd9fc
commit
86f28cdc1d
@ -872,10 +872,13 @@ func (n *TxNotifier) UpdateConfDetails(confRequest ConfRequest,
|
|||||||
func (n *TxNotifier) dispatchConfDetails(
|
func (n *TxNotifier) dispatchConfDetails(
|
||||||
ntfn *ConfNtfn, details *TxConfirmation) error {
|
ntfn *ConfNtfn, details *TxConfirmation) error {
|
||||||
|
|
||||||
// If no details are provided, return early as we can't dispatch.
|
// If there are no conf details to dispatch or if the notification has
|
||||||
if details == nil {
|
// already been dispatched, then we can skip dispatching to this
|
||||||
Log.Debugf("Unable to dispatch %v, no details provided",
|
// client.
|
||||||
ntfn.ConfRequest)
|
if details == nil || ntfn.dispatched {
|
||||||
|
Log.Debugf("Skipping dispatch of conf details(%v) for "+
|
||||||
|
"request %v, dispatched=%v", details, ntfn.ConfRequest,
|
||||||
|
ntfn.dispatched)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user