From 7bd0d7641cfd1aab738f6d9ed1aa202daf0c6dae Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 27 Oct 2022 11:25:12 -0500 Subject: [PATCH] mkfunding: no scriptPubKey on utxo causing crash, so we add one Changelog-Fixed: devtools: `mkfunding` command no longer crashes (abort) Fixes #5363 Assisted-By: @TKChattoraj --- devtools/mkfunding.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devtools/mkfunding.c b/devtools/mkfunding.c index fa817da42..d31ddb4eb 100644 --- a/devtools/mkfunding.c +++ b/devtools/mkfunding.c @@ -144,6 +144,9 @@ int main(int argc, char *argv[]) type_to_string(NULL, struct amount_sat, &input.amount), type_to_string(NULL, struct amount_sat, &fee)); + /* Find the P2WPKH script from input pubkey */ + input.scriptPubkey = scriptpubkey_p2wpkh(NULL, &inputkey); + /* No change output, so we don't need a bip32 base. */ tx = funding_tx(NULL, &input, funding_amount, &funding_localkey, &funding_remotekey);