From d84b596f55707f71691be049a42de8ce104e30b8 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 10 Mar 2020 15:13:50 +0100 Subject: [PATCH] cnct: do not ignore resolver reports after resolution Preparation for anchor resolver. The recovered anchor amount should still be included in the pending channel report even after it has been resolved. This also fixes an existing bug that in some cases caused the recovered amount from an htlc resolver not to be included in the total. --- contractcourt/channel_arbitrator.go | 4 ---- rpcserver.go | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index f0cc1f31..34ed98d3 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -575,10 +575,6 @@ func (c *ChannelArbitrator) Report() []*ContractReport { continue } - if r.IsResolved() { - continue - } - report := r.report() if report == nil { continue diff --git a/rpcserver.go b/rpcserver.go index 841520a3..bed4e79d 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -2817,6 +2817,12 @@ func (r *rpcServer) arbitratorPopulateForceCloseResp(chanPoint *wire.OutPoint, case contractcourt.ReportOutputIncomingHtlc, contractcourt.ReportOutputOutgoingHtlc: + // Don't report details on htlcs that are no longer in + // limbo. + if report.LimboBalance == 0 { + break + } + incoming := report.Type == contractcourt.ReportOutputIncomingHtlc htlc := &lnrpc.PendingHTLC{ Incoming: incoming,