mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
wallet, rpc: listdescriptors does not need unlocked
With the last hardened xpub cache, we don't neeed to have the wallet be unlocked for listdescriptors.
This commit is contained in:
parent
3280704886
commit
e6cf0ed92d
3 changed files with 4 additions and 5 deletions
|
@ -1787,8 +1787,6 @@ RPCHelpMan listdescriptors()
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "listdescriptors is not available for non-descriptor wallets");
|
throw JSONRPCError(RPC_WALLET_ERROR, "listdescriptors is not available for non-descriptor wallets");
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureWalletIsUnlocked(*wallet);
|
|
||||||
|
|
||||||
LOCK(wallet->cs_wallet);
|
LOCK(wallet->cs_wallet);
|
||||||
|
|
||||||
UniValue descriptors(UniValue::VARR);
|
UniValue descriptors(UniValue::VARR);
|
||||||
|
|
|
@ -2269,9 +2269,6 @@ const std::vector<CScript> DescriptorScriptPubKeyMan::GetScriptPubKeys() const
|
||||||
bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out) const
|
bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out) const
|
||||||
{
|
{
|
||||||
LOCK(cs_desc_man);
|
LOCK(cs_desc_man);
|
||||||
if (m_storage.IsLocked()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
FlatSigningProvider provider;
|
FlatSigningProvider provider;
|
||||||
provider.keys = GetKeys();
|
provider.keys = GetKeys();
|
||||||
|
|
|
@ -72,6 +72,10 @@ class ListDescriptorsTest(BitcoinTestFramework):
|
||||||
}
|
}
|
||||||
assert_equal(expected, wallet.listdescriptors())
|
assert_equal(expected, wallet.listdescriptors())
|
||||||
|
|
||||||
|
self.log.info("Test listdescriptors with encrypted wallet")
|
||||||
|
wallet.encryptwallet("pass")
|
||||||
|
assert_equal(expected, wallet.listdescriptors())
|
||||||
|
|
||||||
self.log.info('Test non-active non-range combo descriptor')
|
self.log.info('Test non-active non-range combo descriptor')
|
||||||
node.createwallet(wallet_name='w4', blank=True, descriptors=True)
|
node.createwallet(wallet_name='w4', blank=True, descriptors=True)
|
||||||
wallet = node.get_wallet_rpc('w4')
|
wallet = node.get_wallet_rpc('w4')
|
||||||
|
|
Loading…
Add table
Reference in a new issue