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

Function is_segwit_output

openingd/dualopend.c:865–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863}
864
865static bool is_segwit_output(struct wally_tx_output *output,
866 const u8 *redeemscript)
867{
868 const u8 *wit_prog;
869 if (tal_bytelen(redeemscript) > 0)
870 wit_prog = redeemscript;
871 else
872 wit_prog = wally_tx_output_get_script(tmpctx, output);
873
874 return is_p2wsh(wit_prog, NULL) || is_p2wpkh(wit_prog, NULL);
875}
876
877/* Memory leak detection is DEVELOPER-only because we go to great lengths to
878 * record the backtrace when allocations occur: without that, the leak

Callers 1

run_tx_interactiveFunction · 0.85

Calls 4

tal_bytelenFunction · 0.85
is_p2wshFunction · 0.85
is_p2wpkhFunction · 0.50

Tested by

no test coverage detected