insert htlc used for channel open

This commit is contained in:
Jesse de Wit
2024-02-19 15:05:03 +01:00
parent 04f2ee06bf
commit 5fe08773f7
7 changed files with 87 additions and 2 deletions

View File

@@ -255,7 +255,28 @@ func (i *Interceptor) Intercept(req common.InterceptRequest) common.InterceptRes
}})
if err != nil {
// Don't break here, this is not critical.
log.Printf("paymentHash: %s, failed to insert newly opened channel in history store. %v", reqPaymentHashStr, channelPoint.String())
log.Printf("paymentHash: %s, failed to insert newly opened channel in history store. %v: %v", reqPaymentHashStr, channelPoint.String(), err)
}
err = i.historyStore.AddOpenChannelHtlc(context.TODO(), &history.OpenChannelHtlc{
NodeId: i.nodeid,
PeerId: destination,
ChannelPoint: channelPoint,
OriginalAmountMsat: req.OutgoingAmountMsat,
ForwardAmountMsat: uint64(amt),
IncomingAmountMsat: req.IncomingAmountMsat,
ForwardTime: time.Now(),
})
if err != nil {
// Don't break here, this is not critical.
log.Printf(
"paymentHash: %s, failed to insert htlc used for channel open in history store: channel: %v,"+
" original amount: %v, forward amount: %v",
reqPaymentHashStr,
channelPoint.String(),
req.OutgoingAmountMsat,
amt,
)
}
useLegacyOnionBlob := slices.Contains(i.config.LegacyOnionTokens, token)