[c-lightning] Towards atomic multipath payments
Rusty Russell
rusty at rustcorp.com.au
Tue Jan 15 06:57:54 AEDT 2019
ZmnSCPxj <ZmnSCPxj at protonmail.com> writes:
> Good morning c-lightningers,
>
> I would like to propose a JSON-RPC interface for low-level atomic multipath payments.
Sorry I've been MIA on this thread, but I was in the middle of moving
`pay` out to a plugin.
A result of that is a new `paystatus` command which details all payment
attempts in full detail (not yet persistent across restarts).
I agree that we need to change the APIs, but I think we should do it
differently: have the pay plugin provide `listpays` which merges
`listpayments` back into whole payments.
To do AMP, I think we should make sendpay and listpayments AMP-aware.
1. Add a 'total_amount' and 'attempt_id' optional fields to
sendpay. Defaults are final amount and 0.
2. Change "if we have a concurrent payment, refuse another" to "if total
of payments in flight >= total_amount, refuse".
3. payments table is now indexed by payment_hash, attempt_id.
It's up to the pay plugin to merge these back together for the higher
level users.
Cheers,
Rusty.
More information about the c-lightning
mailing list