multi: move failed attempt cfg option to the router subsytem
Previously we had db and application logic mixed on the db level. We now move the config option KeepFailedPaymentAttempts to the ChannelRouter level and move it out of the db level.
This commit is contained in:
10 files changed
+224
-175
No files matched your search
@@ -338,15 +338,16 @@ lifecycle:
|
||||
// terminal condition. We either return the settled preimage or the
|
||||
// payment's failure reason.
|
||||
//
|
||||
// Optionally delete the failed attempts from the database. Depends on
|
||||
// the database options deleting attempts is not allowed so this will
|
||||
// just be a no-op.
|
||||
err = p.router.cfg.Control.DeleteFailedAttempts(
|
||||
cleanupCtx, p.identifier,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("Error deleting failed htlc attempts for payment "+
|
||||
"%v: %v", p.identifier, err)
|
||||
// Optionally delete the failed attempts from the database. If we are
|
||||
// configured to keep failed payment attempts, we skip deletion.
|
||||
if !p.router.cfg.KeepFailedPaymentAttempts {
|
||||
err = p.router.cfg.Control.DeleteFailedAttempts(
|
||||
cleanupCtx, p.identifier,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("Error deleting failed htlc attempts "+
|
||||
"for payment %v: %v", p.identifier, err)
|
||||
}
|
||||
}
|
||||
|
||||
htlc, failure := payment.TerminalInfo()
|
||||
|
||||
Reference in new issue
Block a user