Skip to content

Commit 496a1bb

Browse files
committed
taproot: Use pre-existing signatures if available
Actually use pre-existing signatures in CreateTaprootScriptSig if a signature is found for the given key and leaf hash.
1 parent 0ad21e7 commit 496a1bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/script/sign.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static bool CreateTaprootScriptSig(const BaseSignatureCreator& creator, Signatur
150150
auto it = sigdata.taproot_script_sigs.find(lookup_key);
151151
if (it != sigdata.taproot_script_sigs.end()) {
152152
sig_out = it->second;
153+
return true;
153154
}
154155
if (creator.CreateSchnorrSig(provider, sig_out, pubkey, &leaf_hash, nullptr, sigversion)) {
155156
sigdata.taproot_script_sigs[lookup_key] = sig_out;

test/functional/wallet_taproot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ def run_test(self):
442442
assert(self.rpc_online.gettransaction(txid)["confirmations"] > 0)
443443

444444
psbt = self.psbt_online.sendall(recipients=[self.boring.getnewaddress()], options={"psbt": True})["psbt"]
445-
res = self.psbt_offline.walletprocesspsbt(psbt)
446-
assert(res['complete'])
445+
res = self.psbt_offline.walletprocesspsbt(psbt=psbt, finalize=False)
447446
rawtx = self.nodes[0].finalizepsbt(res['psbt'])['hex']
448447
txid = self.nodes[0].sendrawtransaction(rawtx)
449448
self.generatetoaddress(self.nodes[0], 1, self.boring.getnewaddress(), sync_fun=self.no_op)

0 commit comments

Comments
 (0)