Skip to content

Commit 31d4575

Browse files
committed
contractcourt: properly detect RBF coop close transactions
This commit fixes an issue where we did not properly detect and therefore record the coop close transaction if it used the newer RBF coop close v2 scheme. This only affects coop closes of taproot channels today.
1 parent fdd28c8 commit 31d4575

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contractcourt/chain_watcher.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/btcsuite/btcd/btcutil"
1313
"github.com/btcsuite/btcd/chaincfg"
1414
"github.com/btcsuite/btcd/chaincfg/chainhash"
15+
"github.com/btcsuite/btcd/mempool"
1516
"github.com/btcsuite/btcd/txscript"
1617
"github.com/btcsuite/btcd/wire"
1718
"github.com/davecgh/go-spew/spew"
@@ -689,7 +690,10 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
689690
// sequence number that's finalized. This won't happen with
690691
// regular commitment transactions due to the state hint
691692
// encoding scheme.
692-
if commitTxBroadcast.TxIn[0].Sequence == wire.MaxTxInSequenceNum {
693+
switch commitTxBroadcast.TxIn[0].Sequence {
694+
case wire.MaxTxInSequenceNum:
695+
fallthrough
696+
case mempool.MaxRBFSequence:
693697
// TODO(roasbeef): rare but possible, need itest case
694698
// for
695699
err := c.dispatchCooperativeClose(commitSpend)

0 commit comments

Comments
 (0)