channeldb+invoices: track invoices by InvoiceRef
This commit is contained in:
5 files changed
+151
-76
No files matched your search
+8
-2
@@ -22,10 +22,16 @@ type invoiceUpdateCtx struct {
|
||||
mpp *record.MPP
|
||||
}
|
||||
|
||||
// invoiceRef returns an identifier that can be used to lookup or update the
|
||||
// invoice this HTLC is targeting.
|
||||
func (i *invoiceUpdateCtx) invoiceRef() channeldb.InvoiceRef {
|
||||
return channeldb.InvoiceRefByHash(i.hash)
|
||||
}
|
||||
|
||||
// log logs a message specific to this update context.
|
||||
func (i *invoiceUpdateCtx) log(s string) {
|
||||
log.Debugf("Invoice(%x): %v, amt=%v, expiry=%v, circuit=%v, mpp=%v",
|
||||
i.hash[:], s, i.amtPaid, i.expiry, i.circuitKey, i.mpp)
|
||||
log.Debugf("Invoice%v: %v, amt=%v, expiry=%v, circuit=%v, mpp=%v",
|
||||
i.invoiceRef, s, i.amtPaid, i.expiry, i.circuitKey, i.mpp)
|
||||
}
|
||||
|
||||
// failRes is a helper function which creates a failure resolution with
|
||||
|
||||
Reference in new issue
Block a user