mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 78cb45d722 into merged_master (Bitcoin PR #19738)
This commit is contained in:
commit
239cea1d22
1 changed files with 5 additions and 3 deletions
|
|
@ -2437,6 +2437,7 @@ std::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins() const
|
|||
|
||||
const CTxOut& CWallet::FindNonChangeParentOutput(const CTransaction& tx, int output) const
|
||||
{
|
||||
AssertLockHeld(cs_wallet);
|
||||
const CTransaction* ptx = &tx;
|
||||
int n = output;
|
||||
while (IsChange(ptx->vout[n]) && ptx->vin.size() > 0) {
|
||||
|
|
@ -4176,6 +4177,7 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s
|
|||
bool CWallet::DelAddressBook(const CTxDestination& address)
|
||||
{
|
||||
bool is_mine;
|
||||
WalletBatch batch(*database);
|
||||
{
|
||||
LOCK(cs_wallet);
|
||||
// If we want to delete receiving addresses, we need to take care that DestData "used" (and possibly newer DestData) gets preserved (and the "deleted" address transformed into a change entry instead of actually being deleted)
|
||||
|
|
@ -4189,7 +4191,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
|
|||
std::string strAddress = EncodeDestination(address);
|
||||
for (const std::pair<const std::string, std::string> &item : m_address_book[address].destdata)
|
||||
{
|
||||
WalletBatch(*database).EraseDestData(strAddress, item.first);
|
||||
batch.EraseDestData(strAddress, item.first);
|
||||
}
|
||||
m_address_book.erase(address);
|
||||
is_mine = IsMine(address) != ISMINE_NO;
|
||||
|
|
@ -4197,8 +4199,8 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
|
|||
|
||||
NotifyAddressBookChanged(this, address, "", is_mine, "", CT_DELETED);
|
||||
|
||||
WalletBatch(*database).ErasePurpose(EncodeDestination(address));
|
||||
return WalletBatch(*database).EraseName(EncodeDestination(address));
|
||||
batch.ErasePurpose(EncodeDestination(address));
|
||||
return batch.EraseName(EncodeDestination(address));
|
||||
}
|
||||
|
||||
size_t CWallet::KeypoolCountExternalKeys() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue