routing: process successes in mission control
This commit modifies paymentLifecycle so that it not only feeds failures into mission control, but successes as well. This allows for more accurate probability estimates. Previously, the success probability for a successful pair and a pair with no history was equal. There was no force that pushed towards previously successful routes.
This commit is contained in:
12 files changed
+415
-190
No files matched your search
@@ -161,6 +161,15 @@ func (p *paymentLifecycle) resumePayment() ([32]byte, *route.Route, error) {
|
||||
log.Debugf("Payment %x succeeded with pid=%v",
|
||||
p.payment.PaymentHash, p.attempt.PaymentID)
|
||||
|
||||
// Report success to mission control.
|
||||
err = p.router.cfg.MissionControl.ReportPaymentSuccess(
|
||||
p.attempt.PaymentID, &p.attempt.Route,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("Error reporting payment success to mc: %v",
|
||||
err)
|
||||
}
|
||||
|
||||
// In case of success we atomically store the db payment and
|
||||
// move the payment to the success state.
|
||||
err = p.router.cfg.Control.Success(p.payment.PaymentHash, result.Preimage)
|
||||
|
||||
Reference in new issue
Block a user