MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_in_out_with_serial

Function add_in_out_with_serial

common/test/run-psbt_diff.c:88–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static void add_in_out_with_serial(struct wally_psbt *psbt,
89 size_t serial_id,
90 size_t default_value)
91{
92 struct bitcoin_outpoint outpoint;
93 u8 *script;
94 struct amount_sat sat;
95 struct wally_psbt_input *in;
96 struct wally_psbt_output *out;
97
98 memset(&outpoint, default_value, sizeof(outpoint));
99 in = psbt_append_input(psbt, &outpoint, default_value,
100 NULL, NULL, NULL);
101 if (!in)
102 abort();
103 psbt_input_set_serial_id(psbt, in, serial_id);
104
105 script = tal_arr(tmpctx, u8, 20);
106 memset(script, default_value, 20);
107 sat = amount_sat(default_value);
108 out = psbt_append_output(psbt, script, sat);
109 if (!out)
110 abort();
111 psbt_output_set_serial_id(psbt, out, serial_id);
112}
113
114/* Try changing up the serial ids */
115static void change_serials(void)

Callers 2

change_serialsFunction · 0.85
mainFunction · 0.85

Calls 6

psbt_append_inputFunction · 0.85
abortFunction · 0.85
psbt_input_set_serial_idFunction · 0.85
psbt_append_outputFunction · 0.85
amount_satClass · 0.70

Tested by

no test coverage detected