mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
fix: get receiving address for Descriptor Wallets
Expected to use wallet's interface instead LegacyScriptPubKeyMan to get a new address
This commit is contained in:
parent
bdbd0b14a7
commit
4064334732
@ -154,10 +154,7 @@ public:
|
||||
std::string getWalletName() override { return m_wallet->GetName(); }
|
||||
bool getNewDestination(const std::string label, CTxDestination& dest) override
|
||||
{
|
||||
auto spk_man = m_wallet->GetLegacyScriptPubKeyMan();
|
||||
if (!spk_man) {
|
||||
return false;
|
||||
}
|
||||
LOCK(m_wallet->cs_wallet);
|
||||
std::string error;
|
||||
return m_wallet->GetNewDestination(label, dest, error);
|
||||
}
|
||||
|
@ -3820,6 +3820,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
|
||||
LegacyScriptPubKeyMan* legacy_spk_man = pwallet->GetLegacyScriptPubKeyMan();
|
||||
if (legacy_spk_man != nullptr) {
|
||||
const PKHash *pkhash = std::get_if<PKHash>(&dest);
|
||||
// TODO: refactor to use hd_seed_id from `meta`
|
||||
if (pkhash && legacy_spk_man->HaveHDKey(ToKeyID(*pkhash), hdChainCurrent)) {
|
||||
ret.pushKV("hdchainid", hdChainCurrent.GetID().GetHex());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user