API: 'listforwards' now include 'payment_hash' field

'payment_hash' can help users learn more about the forward payment.
This commit is contained in:
trueptolemy
2019-06-16 14:04:10 +08:00
committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent ab60bcab7c
commit bcec6bb6cc
2 changed files with 4 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- plugins: a new boolean field can be added to a plugin manifest, `dynamic`. It allows a plugin to tell if it can be started or stopped "on-the-fly".
- lightningd: check bitcoind version when setup topology and confirm the version not older than v0.15.0.
- startup: space out reconnections on startup if we have more than 5 peers.
- JSON API: `listforwards` includes the 'payment_hash' field.
### Deprecated

View File

@@ -2114,6 +2114,9 @@ static void listforwardings_add_forwardings(struct json_stream *response, struct
const struct forwarding *cur = &forwardings[i];
json_object_start(response, NULL);
json_add_hex(response, "payment_hash",
cur->payment_hash,
sizeof(*cur->payment_hash));
json_add_short_channel_id(response, "in_channel", &cur->channel_in);
json_add_short_channel_id(response, "out_channel", &cur->channel_out);
json_add_amount_msat_compat(response,