mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 06:37:21 +01:00
cnct+htlcswitch+invoices: report circuit key to invoice registry
Currently the invoice registry cannot tell apart the htlcs that pay to an invoice. Because htlcs may also be replayed on startup, it isn't possible to determine the total amount paid to an invoice. This commit is a first step towards fixing that. It reports the circuit keys of htlcs to the invoice registry, which forms the basis for accurate invoice accounting.
This commit is contained in:
@@ -2878,9 +2878,14 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
|
||||
// receive back a resolution event.
|
||||
invoiceHash := lntypes.Hash(pd.RHash)
|
||||
|
||||
circuitKey := channeldb.CircuitKey{
|
||||
ChanID: l.ShortChanID(),
|
||||
HtlcID: pd.HtlcIndex,
|
||||
}
|
||||
|
||||
event, err := l.cfg.Registry.NotifyExitHopHtlc(
|
||||
invoiceHash, pd.Amount, pd.Timeout, int32(heightNow),
|
||||
l.hodlQueue.ChanIn(), eob,
|
||||
circuitKey, l.hodlQueue.ChanIn(), eob,
|
||||
)
|
||||
|
||||
switch err {
|
||||
|
||||
Reference in New Issue
Block a user