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:85–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

change_serialsFunction · 0.85
mainFunction · 0.85

Calls 6

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

Tested by

no test coverage detected