Skip to content

Commit 3d2b0d7

Browse files
committed
lnwallet: add field CommitTxBlockHeight to ResolutionReq
Introduce `CommitTxBlockHeight` field to the `ResolutionReq` structure and related methods. This field records the block height where a commitment transaction has confirmed.
1 parent b9ea707 commit 3d2b0d7

File tree

3 files changed

+177
-150
lines changed

3 files changed

+177
-150
lines changed

contractcourt/chain_watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,8 @@ func (c *chainWatcher) dispatchLocalForceClose(
10611061
"detected", c.cfg.chanState.FundingOutpoint)
10621062

10631063
forceClose, err := lnwallet.NewLocalForceCloseSummary(
1064-
c.cfg.chanState, c.cfg.signer, commitSpend.SpendingTx, stateNum,
1064+
c.cfg.chanState, c.cfg.signer, commitSpend.SpendingTx,
1065+
uint32(commitSpend.SpendingHeight), stateNum,
10651066
c.cfg.auxLeafStore, c.cfg.auxResolver,
10661067
)
10671068
if err != nil {

lnwallet/aux_resolutions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ type ResolutionReq struct {
7777
// CommitTx is the force close commitment transaction.
7878
CommitTx *wire.MsgTx
7979

80+
// CommitTxBlockHeight is the block height where the commitment
81+
// transaction confirmed. It is 0 if unknown or not confirmed yet.
82+
CommitTxBlockHeight uint32
83+
8084
// CommitFee is the fee that was paid for the commitment transaction.
8185
CommitFee btcutil.Amount
8286

0 commit comments

Comments
 (0)