json-rpc: Add failcode info in listforwards

This commit is contained in:
trueptolemy 2019-04-26 15:19:04 +08:00 committed by Christian Decker
parent 11e9ad0ee0
commit 3445abb553
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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. */