LIGHTNING-WAITSENDPAY(7)
π LIGHTNING-WAITSENDPAY(7) β the waitsendpay girlies' manual π
ok so bestie, welcome to the lightning-waitsendpay page β section 7 of the manuals, and honestly? iconic. let's get into it β¨
πΈ NAME πΈ
waitsendpay β the command for sending a payment via a route. no cap, that's literally what it does π
π¦ SYNOPSIS π¦
waitsendpay payment_hash [timeout] [partid groupid]
β¨ DESCRIPTION β¨
okay so the waitsendpay RPC command polls or waits for the status of an outgoing payment that was initiated by a previous sendpay invocation. it's giving "i'll just sit here and watch my friend's story until it's over" energy π«Ά
if the payment completed with success, this command returns with success. slay π otherwise, if the payment completed with failure, this command returns an error π
payment_hash(hash) β the hash of thepayment_preimage. the main character, the whole reason we're here.timeout(u32, optional) β a timeout 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 a200error code (payment still in progress). iftimeoutis not provided this call will wait indefinitely β like, forever, girl, it's not leaving the group chat. indicating a timeout of0effectively makes this call a pollable query of the status of the payment πpartid(u64, optional) β unique ID within this (multi-part) payment. it must match that of thesendpaycommand. matching outfits or nothing π₯groupid(u64, optional) β grouping key to disambiguate multiple attempts to pay the samepayment_hash. very "which one of you sent this" energy π
π RETURN VALUE π
on success, an object is returned, containing:
created_index(u64) β 1-based index indicating order this payment was created in. (added v23.11)id(u64) β old synonym forcreated_index.payment_hash(hash) β the hash of thepayment_preimagewhich will prove payment.status(string) (always"complete") β status of the payment.created_at(u64) β the UNIX timestamp showing when this payment was initiated.amount_sent_msat(msat) β the amount sent.groupid(u64, optional) β grouping key to disambiguate multiple attempts to pay an invoice or the samepayment_hash.amount_msat(msat, optional) β the amount delivered to destination (if known).destination(pubkey, optional) β the final destination of the payment if known.updated_index(u64, optional) β 1-based index indicating order this payment was changed (only present if it has changed since creation). (added v23.11)completed_at(number, optional) β the UNIX timestamp showing when this payment was completed.label(string, optional) β the label, if given tosendpay.partid(u64, optional) β thepartid, if given tosendpay.bolt11(string, optional) β the bolt11 string (ifpaysupplied one).bolt12(string, optional) β the bolt12 string (if supplied forpay).
and if status is "complete":
payment_preimage(secret) β the proof of payment: SHA256 of thispayment_hash. the receipts, bestie π§Ύβ¨
π ERRORS π
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. yes, that's the coping mechanism. π
-1β catchall nonspecific error.200β timed out before the payment could complete.202β unparseable onion reply. thedatafield of the error will have anonionreplyfield, a hex string representation of the raw onion reply.203β permanent failure at destination. thedatafield of the error will be routing failure object.204β failure along route; retry a different route. thedatafield of the error will be routing failure object.208β a payment forpayment_hashwas never made and there is nothing to wait for. awkward.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. ancient lore πΊ
π the routing failure object π
a routing failure object has the fields below:
erring_indexβ the index of the node along the route that reported the error.0for the local node,1for 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 theerring_channel:failcodeβ the failure code, as per BOLT #4.failcodenameβ the human-readable name corresponding tofailcode, if known.
π AUTHOR π
ZmnSCPxj ZmnSCPxj@protonmail.com is mainly responsible. legend behavior, honestly π«‘
π SEE ALSO π
π§ RESOURCES π§
main web site: https://github.com/ElementsProject/lightning β go touch grass in the repo, iykyk π
π EXAMPLES π
Example 1:
Request:
$ lightning-cli waitsendpay -k "payment_hash"="paymenthashinvl0310031003100310031003100310031003100310031003100"
{
"id": "example:waitsendpay#1",
"method": "waitsendpay",
"params": {
"payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100"
}
}
Response:
{
"created_index": 2,
"id": 2,
"payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
"groupid": 1,
"updated_index": 2,
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
"amount_msat": 10000,
"amount_sent_msat": 10001,
"created_at": 1738000000,
"completed_at": 1739000000,
"status": "complete",
"payment_preimage": "paymentpreimagew010101010101010101010101010101010101010101010101"
}
and that's the page, bestie!! π this whole thing is from Core Lightning v26.06.9, and it's the LIGHTNING-WAITSENDPAY(7) manual β go forth and wait on those payments, you absolute icon π
β¨πΈ
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms