lightningd: use amount_msat not amount in htlc_accepted_hook.

Changelog-Added: Plugins: `htlc_accepted_hook` `amount_msat` field.
Changelog-Deprecated: Plugins: `htlc_accepted_hook` `amount` field (use `amount_msat`)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-06-20 19:52:01 +09:30
parent cd7e784d6f
commit f6b4dbc65a
2 changed files with 4 additions and 2 deletions

View File

@ -1379,7 +1379,7 @@ The payload of the hook call has the following format:
"htlc": {
"short_channel_id": "4x5x6",
"id": 27,
"amount": "43msat",
"amount_msat": "43msat",
"cltv_expiry": 500028,
"cltv_expiry_relative": 10,
"payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"

View File

@ -1071,7 +1071,9 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p,
json_object_start(s, "htlc");
json_add_short_channel_id(s, "short_channel_id", hin->key.channel->scid);
json_add_u64(s, "id", hin->key.id);
json_add_amount_msat_only(s, "amount", hin->msat);
if (deprecated_apis)
json_add_amount_msat_only(s, "amount", hin->msat);
json_add_amount_msat_only(s, "amount_msat", hin->msat);
json_add_u32(s, "cltv_expiry", expiry);
json_add_s32(s, "cltv_expiry_relative", expiry - blockheight);
json_add_sha256(s, "payment_hash", &hin->payment_hash);