mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Implement ReturnDestination in DescriptorScriptPubKeyMan
This commit is contained in:
@@ -1617,6 +1617,13 @@ bool DescriptorScriptPubKeyMan::GetReservedDestination(const OutputType type, bo
|
|||||||
|
|
||||||
void DescriptorScriptPubKeyMan::ReturnDestination(int64_t index, bool internal, const CTxDestination& addr)
|
void DescriptorScriptPubKeyMan::ReturnDestination(int64_t index, bool internal, const CTxDestination& addr)
|
||||||
{
|
{
|
||||||
|
LOCK(cs_desc_man);
|
||||||
|
// Only return when the index was the most recent
|
||||||
|
if (m_wallet_descriptor.next_index - 1 == index) {
|
||||||
|
m_wallet_descriptor.next_index--;
|
||||||
|
}
|
||||||
|
WalletBatch(m_storage.GetDatabase()).WriteDescriptor(GetID(), m_wallet_descriptor);
|
||||||
|
NotifyCanGetAddressesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<CKeyID, CKey> DescriptorScriptPubKeyMan::GetKeys() const
|
std::map<CKeyID, CKey> DescriptorScriptPubKeyMan::GetKeys() const
|
||||||
|
|||||||
Reference in New Issue
Block a user