Skip to content

Commit

Permalink
x - debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Dec 4, 2024
1 parent a00ed4e commit 36c31dd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lnwallet/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -4574,6 +4574,8 @@ func (lc *LightningChannel) computeView(view *HtlcView,
dryRunFee fn.Option[chainfee.SatPerKWeight]) (lnwire.MilliSatoshi,
lnwire.MilliSatoshi, lntypes.WeightUnit, *HtlcView, error) {

walletLog.Debugf("0----->: whoseCommit=%v", whoseCommitChain)

commitChain := lc.commitChains.Local
dustLimit := lc.channelState.LocalChanCfg.DustLimit
if whoseCommitChain.IsRemote() {
Expand All @@ -4587,6 +4589,9 @@ func (lc *LightningChannel) computeView(view *HtlcView,
ourBalance := commitChain.tip().ourBalance
theirBalance := commitChain.tip().theirBalance

walletLog.Debugf("1--->: ourBalance=%v, theirBalance=%v", ourBalance,
theirBalance)

// Add the fee from the previous commitment state back to the
// initiator's balance, so that the fee can be recalculated and
// re-applied in case fee estimation parameters have changed or the
Expand All @@ -4600,6 +4605,9 @@ func (lc *LightningChannel) computeView(view *HtlcView,
}
nextHeight := commitChain.tip().height + 1

walletLog.Debugf("2--->: ourBalance=%v, theirBalance=%v", ourBalance,
theirBalance)

// Initiate feePerKw to the last committed fee for this chain as we'll
// need this to determine which HTLCs are dust, and also the final fee
// rate.
Expand Down Expand Up @@ -4632,6 +4640,9 @@ func (lc *LightningChannel) computeView(view *HtlcView,
theirBalance -= lnwire.MilliSatoshi(-1 * deltas.Remote)
}

walletLog.Debugf("3--->: ourBalance=%v, theirBalance=%v", ourBalance,
theirBalance)

if updateState {
for _, party := range lntypes.BothParties {
for _, u := range uncommitted.GetForParty(party) {
Expand Down

0 comments on commit 36c31dd

Please sign in to comment.