mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
bkpr: turns out these fields are optional
pushes and channel leases don't provide fees or payment_id info
This commit is contained in:
parent
899d54edd0
commit
8ec35b7eb1
1 changed files with 10 additions and 10 deletions
|
@ -324,23 +324,23 @@ static const char *parse_and_log_channel_move(struct command *cmd,
|
|||
const char *err;
|
||||
|
||||
err = json_scan(tmpctx, buf, params,
|
||||
"{coin_movement:"
|
||||
"{payment_hash:%"
|
||||
",fees:%"
|
||||
"}}",
|
||||
JSON_SCAN(json_to_sha256, &e->payment_id),
|
||||
JSON_SCAN(json_to_msat, &e->fees));
|
||||
|
||||
"{coin_movement:{payment_hash:%}}",
|
||||
JSON_SCAN(json_to_sha256, &e->payment_id));
|
||||
if (err)
|
||||
return err;
|
||||
memset(&e->payment_id, 0, sizeof(struct sha256));
|
||||
|
||||
err = json_scan(tmpctx, buf, params,
|
||||
"{coin_movement:"
|
||||
"{part_id:%}}",
|
||||
"{coin_movement:{part_id:%}}",
|
||||
JSON_SCAN(json_to_number, &e->part_id));
|
||||
if (err)
|
||||
e->part_id = 0;
|
||||
|
||||
err = json_scan(tmpctx, buf, params,
|
||||
"{coin_movement:{fees_msat:%}}",
|
||||
JSON_SCAN(json_to_msat, &e->fees));
|
||||
if (err)
|
||||
e->fees = AMOUNT_MSAT(0);
|
||||
|
||||
e->credit = credit;
|
||||
e->debit = debit;
|
||||
e->currency = tal_steal(e, coin_type);
|
||||
|
|
Loading…
Add table
Reference in a new issue