Skip to content

Commit

Permalink
json-rpc: Add failcode info in listforwards
Browse files Browse the repository at this point in the history
  • Loading branch information
trueptolemy committed May 2, 2019
1 parent 489fac1 commit 0e34c8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- JSON API: new plugin `invoice_payment` hook for intercepting invoices before they're paid.
- plugin: the `connected` hook can now send an `error_message` to the rejected peer.
- Protocol: we now enforce `option_upfront_shutdown_script` if a peer negotiates it.
- JSON API: `listforwards` now includes the local_failed forwards with failcode (Issue [#2435](https://github.com/ElementsProject/lightning/issues/2435), PR [#2524](https://github.com/ElementsProject/lightning/pull/2524))

### Changed

Expand Down
6 changes: 6 additions & 0 deletions lightningd/peer_htlcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,12 @@ static void listforwardings_add_forwardings(struct json_stream *response, struct
"fee", "fee_msat");
json_add_string(response, "status", forward_status_name(cur->status));

if(cur->failcode != 0) {
json_add_num(response, "failcode", cur->failcode);
json_add_string(response, "failreason",
onion_type_name(cur->failcode));
}

#ifdef COMPAT_V070
/* If a forwarding doesn't have received_time it was created
* before we added the tracking, do not include it here. */
Expand Down

0 comments on commit 0e34c8e

Please sign in to comment.