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 committed 2020-04-09 08:20:49 +02:00
1 parent 46f5fc7400
commit e9bd691e6a
10 files changed
+520 -197

No files matched your search

+4
View File
@@ -3962,6 +3962,10 @@ func (r *rpcServer) dispatchPaymentIntent(
DestCustomRecords: payIntent.destCustomRecords,
DestFeatures: payIntent.destFeatures,
PaymentAddr: payIntent.paymentAddr,
// Don't enable multi-part payments on the main rpc.
// Users need to use routerrpc for that.
MaxHtlcs: 1,
}
preImage, route, routerErr = r.server.chanRouter.SendPayment(