2019-08-31 14:30:56 +02:00
|
|
|
lightning-waitsendpay -- Command for sending a payment via a route
|
|
|
|
==================================================================
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
2022-01-26 18:18:49 +01:00
|
|
|
**waitsendpay** *payment\_hash* [*timeout*] [*partid*]
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The **waitsendpay** RPC command polls or waits for the status of an
|
|
|
|
outgoing payment that was initiated by a previous **sendpay**
|
|
|
|
invocation.
|
|
|
|
|
2019-12-12 11:57:07 +01:00
|
|
|
The *partid* argument must match that of the **sendpay** command.
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
Optionally the client may provide a *timeout*, an integer in seconds,
|
|
|
|
for this RPC command to return. If the *timeout* is provided and the
|
|
|
|
given amount of time passes without the payment definitely succeeding or
|
|
|
|
definitely failing, this command returns with a 200 error code (payment
|
|
|
|
still in progress). If *timeout* is not provided this call will wait
|
|
|
|
indefinitely.
|
|
|
|
|
|
|
|
Indicating a *timeout* of 0 effectively makes this call a pollable query
|
|
|
|
of the status of the payment.
|
|
|
|
|
|
|
|
If the payment completed with success, this command returns with
|
|
|
|
success. Otherwise, if the payment completed with failure, this command
|
|
|
|
returns an error.
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
|
|
|
On success, an object is returned, containing:
|
2022-09-05 23:33:09 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
- **id** (u64): unique ID for this payment attempt
|
2022-09-05 23:45:06 +02:00
|
|
|
- **payment\_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
|
2021-06-16 03:10:17 +02:00
|
|
|
- **status** (string): status of the payment (always "complete")
|
2022-09-05 23:45:06 +02:00
|
|
|
- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated
|
|
|
|
- **amount\_sent\_msat** (msat): The amount sent
|
2021-09-28 18:05:33 +02:00
|
|
|
- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash
|
2022-09-05 23:45:06 +02:00
|
|
|
- **amount\_msat** (msat, optional): The amount delivered to destination (if known)
|
2021-06-16 03:10:17 +02:00
|
|
|
- **destination** (pubkey, optional): the final destination of the payment if known
|
2022-06-09 18:36:00 +02:00
|
|
|
- **completed\_at** (number, optional): the UNIX timestamp showing when this payment was completed
|
2021-06-16 03:10:17 +02:00
|
|
|
- **label** (string, optional): the label, if given to sendpay
|
|
|
|
- **partid** (u64, optional): the *partid*, if given to sendpay
|
|
|
|
- **bolt11** (string, optional): the bolt11 string (if pay supplied one)
|
|
|
|
- **bolt12** (string, optional): the bolt12 string (if supplied for pay: **experimental-offers** only).
|
|
|
|
|
|
|
|
If **status** is "complete":
|
2022-09-05 23:33:09 +02:00
|
|
|
|
2022-09-05 23:45:06 +02:00
|
|
|
- **payment\_preimage** (secret): the proof of payment: SHA256 of this **payment_hash** (always 64 characters)
|
2021-09-03 12:07:59 +02:00
|
|
|
|
2021-06-16 03:10:17 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
On error, and even if the error occurred from a node other than the
|
|
|
|
final destination, the route table will no longer be updated. Use the
|
|
|
|
*exclude* parameter of the `getroute` command to ignore the failing
|
|
|
|
route.
|
|
|
|
|
|
|
|
The following error codes may occur:
|
|
|
|
- -1: Catchall nonspecific error.
|
|
|
|
- 200: Timed out before the payment could complete.
|
|
|
|
- 202: Unparseable onion reply. The *data* field of the error will
|
|
|
|
have an *onionreply* field, a hex string representation of the raw
|
|
|
|
onion reply.
|
|
|
|
- 203: Permanent failure at destination. The *data* field of the error
|
|
|
|
will be routing failure object.
|
|
|
|
- 204: Failure along route; retry a different route. The *data* field
|
|
|
|
of the error will be routing failure object.
|
|
|
|
- 208: A payment for *payment\_hash* was never made and there is
|
|
|
|
nothing to wait for.
|
|
|
|
- 209: The payment already failed, but the reason for failure was not
|
|
|
|
stored. This should only occur when querying failed payments on very
|
|
|
|
old databases.
|
|
|
|
|
|
|
|
A routing failure object has the fields below:
|
|
|
|
- *erring\_index*: The index of the node along the route that reported
|
|
|
|
the error. 0 for the local node, 1 for the first hop, and so on.
|
|
|
|
- *erring\_node*: The hex string of the pubkey id of the node that
|
|
|
|
reported the error.
|
|
|
|
- *erring\_channel*: The short channel ID of the channel that has the
|
|
|
|
error (or the final channel if the destination raised the error).
|
|
|
|
- *erring\_direction*: The direction of traversing the
|
|
|
|
*erring\_channel*:
|
|
|
|
- *failcode*: The failure code, as per BOLT \#4.
|
|
|
|
- *failcodename*: The human-readable name corresponding to *failcode*,
|
|
|
|
if known.
|
|
|
|
|
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
|
|
|
ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
|
|
|
lightning-sendpay(7), lightning-pay(7).
|
|
|
|
|
|
|
|
RESOURCES
|
|
|
|
---------
|
|
|
|
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
2020-08-25 03:33:16 +02:00
|
|
|
|
2022-06-09 18:36:00 +02:00
|
|
|
[comment]: # ( SHA256STAMP:f4dbe3ecc88a294f7bb983a2f2b8e9613e440e4564580e51dd30fc83ba218a91)
|