routerrpc+routing: adapt payment session for multi shard send

Modifies the payment session to launch additional pathfinding attempts
for lower amounts. If a single shot payment isn't possible, the goal is
to try to complete the payment using multiple htlcs. In previous
commits, the payment lifecycle has been prepared to deal with
partial-amount routes returned from the payment session. It will query
for additional shards if needed.

Additionally a new rpc payment parameter is added that controls the
maximum number of shards that will be used for the payment.
This commit is contained in:
Joost Jager
2020-01-28 16:07:34 +01:00
parent 46f5fc7400
commit e9bd691e6a
10 changed files with 520 additions and 197 deletions

View File

@ -1624,6 +1624,10 @@ type LightningPayment struct {
// understand this new onion payload format, then the payment will
// fail.
DestCustomRecords record.CustomSet
// MaxHtlcs is the maximum number of partial payments that may be use to
// complete the full amount.
MaxHtlcs uint32
}
// SendPayment attempts to send a payment as described within the passed