Skip to content

Commit

Permalink
Merge #1588: [GUI][Bug] Fix editing of CS address labels
Browse files Browse the repository at this point in the history
805e436 [GUI][Bug] Fix editing of CS address labels (Fuzzbawls)

Pull request description:

  Fixes a bug that prevented the editing of Cold Staking address labels in
  the address book due to the passing of an empty purpose, which
  `CWallet::ParseIntoAddress()` needs in order to determine if an address
  is a cold staking type address.

ACKs for top commit:
  random-zebra:
    ACK 805e436
  furszy:
    utACK 805e436

Tree-SHA512: 73adff6e13ecb5232c49ba9be7a082e1f8b4f603d9d42c664ee98bd144d53e5cbf9b129524eca0d6fa017f9f9b34b83872e4a7b31bb1aa33f0fb1b02cf7e0aa8
  • Loading branch information
random-zebra committed May 5, 2020
2 parents 72595d7 + 805e436 commit 7694d5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2890,10 +2890,10 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s
mapAddressBook[address].purpose = strPurpose;
}
NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address) != ISMINE_NO,
strPurpose, (fUpdated ? CT_UPDATED : CT_NEW));
mapAddressBook.at(address).purpose, (fUpdated ? CT_UPDATED : CT_NEW));
if (!fFileBacked)
return false;
std::string addressStr = ParseIntoAddress(address, strPurpose).ToString();
std::string addressStr = ParseIntoAddress(address, mapAddressBook.at(address).purpose).ToString();
if (!strPurpose.empty() && !CWalletDB(strWalletFile).WritePurpose(addressStr, strPurpose))
return false;
return CWalletDB(strWalletFile).WriteName(addressStr, strName);
Expand Down

0 comments on commit 7694d5f

Please sign in to comment.