bark: Fix 'ln status' can't find payment hash for outgoing payments
This PR fixes a bug where bark ln status <payment_hash|invoice> reports “No invoice found” for outgoing Lightning payments, even when the payment was successful and visible in bark movements.
The issue occurred because the command only checked Lightning receives (incoming invoices) and ignored Lightning sends (outgoing payments).
This change extends the lookup logic to also check Lightning sends, allowing ln status to correctly resolve and return the corresponding payment_hash or invoice for outgoing payments.
Invoice paid:
{
"id": 6,
"status": "successful",
"subsystem": {
"name": "bark.lightning_send",
"kind": "send"
},
"metadata": {
"payment_hash": "958cd22387d3fe6a753be6030274c87984aa71bc696c6c7070239e9552d98054",
"htlc_vtxos": [
"a234fade70c44d1aaa2c20f288d7613454ae66ea7ea96cf72651914aaa87ed1c:0"
]
},
"intended_balance_sat": -1000,
"effective_balance_sat": -1000,
"offchain_fee_sat": 0,
"sent_to": [
{
"destination": {
"type": "invoice",
"value": "lntbs10u1p54dyvzsp5yefex3hqkruylluztfz28cn3qp9s4ce2ga0x5zsdpyw9hxglc6tspp5jkxdygu860lx5afmucpsyaxg0xz25udud9kxcursyw0f25kesp2qdq5g9exkgznw3hhyefqyv6sxqzjccqp2rzjqdwy5et9ygczjl2jqmr9e5xm28u3gksjfrf0pht04uwz2lt9d59cypqelcqqq8gqqqqqqqqpqqqqqzsqqc9qxpqysgqlyxndmz288hl95ryd7zkyhsdde0aygh9y8sl7xrtngkwhslehruj64g7y8rs96phn6tavwlu2uhh763glu5k8xq5x8sck9tmxnrvdzgqn4mnq3"
},
"amount_sat": 1000
}
],
"received_on": [],
"input_vtxos": [
"cd0c6b4ec3fa1ea99faa1be34cfaae7aa894c9b999aece743a9250f3b56c1e11:0"
],
"output_vtxos": [
"a234fade70c44d1aaa2c20f288d7613454ae66ea7ea96cf72651914aaa87ed1c:1"
],
"exited_vtxos": [],
"time": {
"created_at": "2026-01-01T16:31:50.548952+01:00",
"updated_at": "2026-01-01T16:31:50.734553+01:00",
"completed_at": "2026-01-01T17:28:08.977552+01:00"
}
}
bark ln status <PAYMENT_HASH|INVOICE> success:
./bark ln status 958cd22387d3fe6a753be6030274c87984aa71bc696c6c7070239e9552d98054 in zsh at 21:25:24
[2026-01-01 21:54:17.887 INFO] Connecting to Ark server using TLS...
[2026-01-01 21:54:18.834 INFO] Ark info: ArkInfo { network: Signet, server_pubkey: PublicKey(6b9f9f1221ec2a2912e1a398ffe693f162372db406adc1cede3d17b6c158f3f0566eba828422d93e947193938274ccdc908d25b09e17f0cd61660186b1610be0), mailbox_pubkey: PublicKey(0b09f06def0620c4279e45fcf1e6487588987d0fcc9384ce34b1bb8abf5fe5f36541cbe09afc0819546d327225b07145045a04b08393bb5fa32a5dd374ba3aae), round_interval: 30s, nb_round_nonces: 10, vtxo_exit_delta: 12, vtxo_expiry_delta: 144, htlc_send_expiry_delta: 256, htlc_expiry_delta: 6, max_vtxo_amount: Some(100000000 SAT), required_board_confirmations: 1, max_user_invoice_cltv_delta: 250, min_board_amount: 10000 SAT, offboard_feerate: FeeRate(2500), ln_receive_anti_dos_required: false }
[2026-01-01 21:54:18.837 INFO] Syncing wallet...
{
"amount_sat": 1000,
"payment_hash": "958cd22387d3fe6a753be6030274c87984aa71bc696c6c7070239e9552d98054",
"invoice": "lntbs10u1p54dyvzsp5yefex3hqkruylluztfz28cn3qp9s4ce2ga0x5zsdpyw9hxglc6tspp5jkxdygu860lx5afmucpsyaxg0xz25udud9kxcursyw0f25kesp2qdq5g9exkgznw3hhyefqyv6sxqzjccqp2rzjqdwy5et9ygczjl2jqmr9e5xm28u3gksjfrf0pht04uwz2lt9d59cypqelcqqq8gqqqqqqqqpqqqqqzsqqc9qxpqysgqlyxndmz288hl95ryd7zkyhsdde0aygh9y8sl7xrtngkwhslehruj64g7y8rs96phn6tavwlu2uhh763glu5k8xq5x8sck9tmxnrvdzgqn4mnq3",
"preimage": "be2d14eb0a899027c99eec6dbe136a53932e2030398809b80be88589b5d9f019",
"htlc_vtxos": [
{
"id": "a234fade70c44d1aaa2c20f288d7613454ae66ea7ea96cf72651914aaa87ed1c:0",
"amount_sat": 1000,
"policy_type": "server-htlc-send",
"user_pubkey": "0222557f962c45281b93a08f4cbf499f9eed1eaa4978c23b03880b8ea129f78c58",
"server_pubkey": "02f0f358c1b6173ddecec1ad06b42d3762f193e6ff98a3e112292aec21129f9f6b",
"expiry_height": 285264,
"exit_delta": 12,
"chain_anchor": "fdec39e12fc606db1fd12ed12dfb36f3e012aa4f7950fd1d5ed6aa47ca5df33f:0",
"exit_depth": 2,
"state": {
"type": "spent"
}
}
]
}
Closes #1322 (closed) Closes #1295 (closed)
Edited by Duncan Dean