Skip to content

Commit

Permalink
[GUI][Bug] Fix editing of CS address labels
Browse files Browse the repository at this point in the history
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.

Github-Pull: PIVX-Project#1588
Rebased-From: 805e436
  • Loading branch information
Fuzzbawls committed May 5, 2020
1 parent 6fc5a2d commit 323ba4e
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 323ba4e

Please sign in to comment.