| 863 | } |
| 864 | |
| 865 | static 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 |
no test coverage detected