mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
psbt: only compare a subset of psbt input/output fields
At some point, it's ok to add more extra info to a psbt and still not have that be counted as 'diff'd.
This commit is contained in:
@@ -72,8 +72,15 @@ static const u8 *linearize_input(const tal_t *ctx,
|
|||||||
|
|
||||||
/* Sort the inputs, so serializing them is ok */
|
/* Sort the inputs, so serializing them is ok */
|
||||||
wally_map_sort(&psbt->inputs[0].unknowns, 0);
|
wally_map_sort(&psbt->inputs[0].unknowns, 0);
|
||||||
wally_map_sort(&psbt->inputs[0].keypaths, 0);
|
|
||||||
wally_map_sort(&psbt->inputs[0].signatures, 0);
|
/* signatures, keypaths, etc - we dont care if they change */
|
||||||
|
psbt->inputs[0].final_witness = NULL;
|
||||||
|
psbt->inputs[0].final_scriptsig_len = 0;
|
||||||
|
psbt->inputs[0].witness_script_len = 0;
|
||||||
|
psbt->inputs[0].redeem_script_len = 0;
|
||||||
|
psbt->inputs[0].keypaths.num_items = 0;
|
||||||
|
psbt->inputs[0].signatures.num_items = 0;
|
||||||
|
|
||||||
|
|
||||||
const u8 *bytes = psbt_get_bytes(ctx, psbt, &byte_len);
|
const u8 *bytes = psbt_get_bytes(ctx, psbt, &byte_len);
|
||||||
|
|
||||||
@@ -102,7 +109,12 @@ static const u8 *linearize_output(const tal_t *ctx,
|
|||||||
psbt->num_outputs++;
|
psbt->num_outputs++;
|
||||||
/* Sort the outputs, so serializing them is ok */
|
/* Sort the outputs, so serializing them is ok */
|
||||||
wally_map_sort(&psbt->outputs[0].unknowns, 0);
|
wally_map_sort(&psbt->outputs[0].unknowns, 0);
|
||||||
wally_map_sort(&psbt->outputs[0].keypaths, 0);
|
|
||||||
|
/* We don't care if the keypaths change */
|
||||||
|
psbt->outputs[0].keypaths.num_items = 0;
|
||||||
|
/* And you can add scripts, no problem */
|
||||||
|
psbt->outputs[0].witness_script_len = 0;
|
||||||
|
psbt->outputs[0].redeem_script_len = 0;
|
||||||
|
|
||||||
const u8 *bytes = psbt_get_bytes(ctx, psbt, &byte_len);
|
const u8 *bytes = psbt_get_bytes(ctx, psbt, &byte_len);
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ openchannel2_changed_hook_serialize(struct openchannel2_psbt_payload *payload,
|
|||||||
json_add_psbt(stream, "psbt", payload->psbt);
|
json_add_psbt(stream, "psbt", payload->psbt);
|
||||||
json_add_string(stream, "channel_id",
|
json_add_string(stream, "channel_id",
|
||||||
type_to_string(tmpctx, struct channel_id,
|
type_to_string(tmpctx, struct channel_id,
|
||||||
&payload->rcvd->channel->cid));
|
&payload->rcvd->cid));
|
||||||
json_object_end(stream);
|
json_object_end(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user