-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GUI][Bug] Fix editing of CS address labels #1588
Conversation
3719984
to
ef83a3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
Just some points on the proposed code changes.
src/wallet/wallet.cpp
Outdated
std::string addressStr = ParseIntoAddress(address, strPurpose).ToString(); | ||
if (!strPurpose.empty() && !CWalletDB(strWalletFile).WritePurpose(addressStr, strPurpose)) | ||
std::string addressStr = ParseIntoAddress(address, (strPurpose.empty() && fUpdated) ? mapAddressBook.at(address).purpose : strPurpose).ToString(); | ||
if ((!fUpdated || fUpdatePurpose) && !CWalletDB(strWalletFile).WritePurpose(addressStr, strPurpose)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be totally sure over the write purpose process, would use the IsMine
method call that is few lines above to verify that the address is really from this wallet (no need to do any extra processing, just use what we already have here). And throw an exception if the wallet, for whatever reason, is trying to store an external address with the receive/cold_staking purpose.
ef83a3d
to
f6aa59c
Compare
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.
f6aa59c
to
805e436
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 805e436
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 805e436
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
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 addressis a cold staking type address.