lnwallet: use the FundingBroadcastHeight as height hint for spend ntfns
This commit is contained in:
parent
e72b030054
commit
54f849a62e
@ -799,8 +799,18 @@ func NewLightningChannel(signer Signer, events chainntnfs.ChainNotifier,
|
|||||||
// the remote party has broadcasted a commitment transaction
|
// the remote party has broadcasted a commitment transaction
|
||||||
// on-chain.
|
// on-chain.
|
||||||
fundingOut := &lc.fundingTxIn.PreviousOutPoint
|
fundingOut := &lc.fundingTxIn.PreviousOutPoint
|
||||||
openHeight := lc.channelState.OpeningHeight
|
|
||||||
channelCloseNtfn, err := lc.channelEvents.RegisterSpendNtfn(fundingOut, openHeight)
|
// As a height hint, we'll try to use the opening height, but
|
||||||
|
// if the channel isn't yet open, then we'll use the height it
|
||||||
|
// was broadcast at.
|
||||||
|
heightHint := lc.channelState.OpeningHeight
|
||||||
|
if heightHint == 0 {
|
||||||
|
heightHint = lc.channelState.FundingBroadcastHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
channelCloseNtfn, err := lc.channelEvents.RegisterSpendNtfn(
|
||||||
|
fundingOut, heightHint,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user