mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
wallet: also search taproot pubkeys in FillPSBT
When filling a PSBT, we search the listed pubkeys in order to determine whether the current DescriptorScriptPubKeyMan could sign the transaction even if it is not watching the scripts. With Taproot, the taproot pubkeys need to be searched as well.
This commit is contained in:
parent
6cff82722f
commit
a73b56888a
1 changed files with 13 additions and 0 deletions
|
@ -2180,6 +2180,19 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
|
|||
*keys = Merge(*keys, *pk_keys);
|
||||
}
|
||||
}
|
||||
for (const auto& pk_pair : input.m_tap_bip32_paths) {
|
||||
const XOnlyPubKey& pubkey = pk_pair.first;
|
||||
for (unsigned char prefix : {0x02, 0x03}) {
|
||||
unsigned char b[33] = {prefix};
|
||||
std::copy(pubkey.begin(), pubkey.end(), b + 1);
|
||||
CPubKey fullpubkey;
|
||||
fullpubkey.Set(b, b + 33);
|
||||
std::unique_ptr<FlatSigningProvider> pk_keys = GetSigningProvider(fullpubkey);
|
||||
if (pk_keys) {
|
||||
*keys = Merge(*keys, *pk_keys);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SignPSBTInput(HidingSigningProvider(keys.get(), !sign, !bip32derivs), psbtx, i, &txdata, sighash_type, nullptr, finalize);
|
||||
|
|
Loading…
Add table
Reference in a new issue