mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
contractcourt: fix taproot coop close db record bug
In this commit, we fix an issue with co-op closes for taproot channels. Before this commit, we'd think that the remote party broadcasted a state very far in the future, and try to execute DLP. The wallet would properly credit the settled funds, but we'd mark the close in the DB as a force close. To fix this, we also watch for the RBF sequence number we use in this scenario.
This commit is contained in:
parent
e7747442d3
commit
3262c45266
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/mempool"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
@ -714,7 +715,10 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
|
|||
// sequence number that's finalized. This won't happen with
|
||||
// regular commitment transactions due to the state hint
|
||||
// encoding scheme.
|
||||
if commitTxBroadcast.TxIn[0].Sequence == wire.MaxTxInSequenceNum {
|
||||
switch commitTxBroadcast.TxIn[0].Sequence {
|
||||
case wire.MaxTxInSequenceNum:
|
||||
fallthrough
|
||||
case mempool.MaxRBFSequence:
|
||||
// TODO(roasbeef): rare but possible, need itest case
|
||||
// for
|
||||
err := c.dispatchCooperativeClose(commitSpend)
|
||||
|
|
Loading…
Add table
Reference in a new issue