diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-07 18:47:28 +0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-07 18:47:38 +0800 |
commit | 63dad673487d3623f9076721d2a1924263272eb9 (patch) | |
tree | 5840b35c0d1f2ca5755f34e1485057a7bb0ee570 /src/wallet/wallet.cpp | |
parent | d12568e2f8863e76d82de3c6bd933e9f5c20daaf (diff) | |
parent | 7a2ecf16df938dd95d3130a46082def7a02338eb (diff) | |
download | bitcoin-63dad673487d3623f9076721d2a1924263272eb9.tar.xz |
Merge #18546: Bugfix: Wallet: Safely deal with change in the address book [part 2]
7a2ecf16df938dd95d3130a46082def7a02338eb Wallet: Change IsMine check in CWallet::DelAddressBook from assert to failure (Luke Dashjr)
2952c46b923042f2de801f319e03ed5c4c4eb735 Wallet: Replace CAddressBookData.name with GetLabel() method (Luke Dashjr)
d7092c392e10889cd7a080b3d22ed6446a59b87a QA: Test that change doesn't turn into non-change when spent in an avoid-reuse wallet (Luke Dashjr)
Pull request description:
Follow-up to #18192, not strictly necessary for 0.20
ACKs for top commit:
MarcoFalke:
re-ACK 7a2ecf16df, only change is adding an assert_equal in the test 🔰
jnewbery:
utACK 7a2ecf16df938dd95d3130a46082def7a02338eb
Tree-SHA512: e0933ee40f705b751697dc27249e1868ed4874254b174ebdd0a7150125d8c818402e66df2371718c7eeb90e67ee2317215fb260aa9b9d7b9b45ee436de2988ff
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9ee3bbd038..45f5542cad 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3221,7 +3221,10 @@ bool CWallet::DelAddressBook(const CTxDestination& address) // 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) // NOTE: This isn't a problem for sending addresses because they never have any DestData yet! // When adding new DestData, it should be considered here whether to retain or delete it (or move it?). - assert(!IsMine(address)); + if (IsMine(address)) { + WalletLogPrintf("%s called with IsMine address, NOT SUPPORTED. Please report this bug! %s\n", __func__, PACKAGE_BUGREPORT); + return false; + } { LOCK(cs_wallet); @@ -3472,7 +3475,7 @@ std::set<CTxDestination> CWallet::GetLabelAddresses(const std::string& label) co { if (item.second.IsChange()) continue; const CTxDestination& address = item.first; - const std::string& strName = item.second.name; + const std::string& strName = item.second.GetLabel(); if (strName == label) result.insert(address); } |