mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge UP TO 48174c0f28 into merged_master (UP TO Bitcoin PR bitcoin/bitcoin#26240)
FIXME in wallet_taproot.py functional test 1668424146 2022-11-14T12:09:06+01:0048174c0f28Bitcoin Merge bitcoin/bitcoin#26240: rpc: Adjust RPCTypeCheckObj error string 1668417474 2022-11-14T10:17:54+01:0059e00c7e03Bitcoin Merge bitcoin/bitcoin#25714: univalue: Avoid std::string copies 1668111238 2022-11-10T15:13:58-05:007ef730ca84Bitcoin Merge bitcoin/bitcoin#26483: test: Don't pass add_to_wallet option to walletcreatefundedpsbt 1668004459 2022-11-09T15:34:19+01:009dce30194bBitcoin Merge bitcoin/bitcoin#26472: test: add missing bech32m / BIP86 test-cases to wallet_descriptor.py 1667992471 2022-11-09T12:14:31+01:0044ca5d5e87Bitcoin Merge bitcoin/bitcoin#26473: test: Avoid collision with valid path names in `getarg_tests/logargs` 1667640759 2022-11-05T10:32:39+01:0050422b770aBitcoin Merge bitcoin/bitcoin#26419: log: mempool: log removal reason in validation interface 1667636699 2022-11-05T09:24:59+01:00ce57dbac90Bitcoin Merge bitcoin/bitcoin#26449: rpc: doc: add missing option "bech32m" for `change_type` parameters 1667577253 2022-11-04T15:54:13+00:00ae6bb6e71eBitcoin Merge bitcoin/bitcoin#26418: Fix signing of multi_a and rawtr scripts with wallets that only have corresponding keys
This commit is contained in:
commit
7ea69ff0d8
18 changed files with 193 additions and 114 deletions
|
|
@ -2509,14 +2509,23 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
|
|||
keys->Merge(std::move(*script_keys));
|
||||
} else {
|
||||
// Maybe there are pubkeys listed that we can sign for
|
||||
script_keys = std::make_unique<FlatSigningProvider>();
|
||||
for (const auto& pk_pair : input.hd_keypaths) {
|
||||
const CPubKey& pubkey = pk_pair.first;
|
||||
std::unique_ptr<FlatSigningProvider> pk_keys = GetSigningProvider(pubkey);
|
||||
if (pk_keys) {
|
||||
keys->Merge(std::move(*pk_keys));
|
||||
}
|
||||
std::vector<CPubKey> pubkeys;
|
||||
|
||||
// ECDSA Pubkeys
|
||||
for (const auto& [pk, _] : input.hd_keypaths) {
|
||||
pubkeys.push_back(pk);
|
||||
}
|
||||
|
||||
// Taproot output pubkey
|
||||
std::vector<std::vector<unsigned char>> sols;
|
||||
if (Solver(script, sols) == TxoutType::WITNESS_V1_TAPROOT) {
|
||||
sols[0].insert(sols[0].begin(), 0x02);
|
||||
pubkeys.emplace_back(sols[0]);
|
||||
sols[0][0] = 0x03;
|
||||
pubkeys.emplace_back(sols[0]);
|
||||
}
|
||||
|
||||
// Taproot pubkeys
|
||||
for (const auto& pk_pair : input.m_tap_bip32_paths) {
|
||||
const XOnlyPubKey& pubkey = pk_pair.first;
|
||||
for (unsigned char prefix : {0x02, 0x03}) {
|
||||
|
|
@ -2524,10 +2533,14 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
|
|||
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(std::move(*pk_keys));
|
||||
}
|
||||
pubkeys.push_back(fullpubkey);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& pubkey : pubkeys) {
|
||||
std::unique_ptr<FlatSigningProvider> pk_keys = GetSigningProvider(pubkey);
|
||||
if (pk_keys) {
|
||||
keys->Merge(std::move(*pk_keys));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue