routing: add new PayAttemptTimeout field to LightningPayment

In this commit, we add a new field to the LightningPayment struct:
PayAttemptTimeout. This new field allows the caller to control exactly
how much time should be spent attempting to route a payment to the
destination. The default value we’ll use is 60 seconds, but callers are
able to specify a diff value. Once the timeout has passed, we’ll
abandon th e payment attempt, and return an error back to the original
caller.
This commit is contained in:
Olaoluwa Osuntokun
2018-03-19 18:44:41 -07:00
parent 237ed4fc6e
commit 363cec7012
2 changed files with 45 additions and 0 deletions

View File

@@ -38,6 +38,10 @@ const (
// this update can't bring us something new, or because a node
// announcement was given for node not found in any channel.
ErrIgnored
// ErrPaymentAttemptTimeout is an error that indicates that a payment
// attempt timed out before we were able to successfully route an HTLC.
ErrPaymentAttemptTimeout
)
// routerError is a structure that represent the error inside the routing package,