From 9382fcb8016da3f50c90742ed12cfcbb15703cce Mon Sep 17 00:00:00 2001 From: ziggie Date: Wed, 19 Feb 2025 22:03:48 +0100 Subject: [PATCH] multi: fix debug log --- htlcswitch/link.go | 2 +- lnwallet/channel.go | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 77c8f67e3..e8e20973e 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -3450,7 +3450,7 @@ func (l *channelLink) canSendHtlc(policy models.ForwardingPolicy, // Check to see if there is enough balance in this channel. if amt > availableBandwidth { l.log.Warnf("insufficient bandwidth to route htlc: %v is "+ - "larger than %v", amt, l.Bandwidth()) + "larger than %v", amt, availableBandwidth) cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage { return lnwire.NewTemporaryChannelFailure(upd) } diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 345eef3be..bc9820e8f 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -8871,13 +8871,16 @@ func (lc *LightningChannel) availableCommitmentBalance(view *HtlcView, ourBalance, futureCommitWeight, feePerKw, buffer, ) if err != nil { - lc.log.Warnf("Set available amount to 0 because we "+ - "could not pay for the CommitmentFee of the "+ - "new ChannelState: ourBalance is negative "+ - "after applying the fee: ourBalance=%v, "+ + lc.log.Debugf("No available local balance after "+ + "applying the CommitmentFee of the new "+ + "CommitmentState(%v): ourBalance would drop "+ + "below the reserve: "+ + "ourBalance(w/o reserve)=%v, reserve=%v, "+ "current commitFee(w/o additional htlc)=%v, "+ - "feeBuffer=%v (type=%v) local_chan_initiator", - ourBalance, commitFee, bufferAmt, buffer) + "feeBuffer=%v (type=%v) "+ + "local_chan_initiator=%v", whoseCommitChain, + ourBalance, ourReserve, commitFee, bufferAmt, + buffer, lc.channelState.IsInitiator) return 0, commitWeight }