From 1021b81147825be8e1252dc20be5ca6220e72254 Mon Sep 17 00:00:00 2001 From: Duddino Date: Sun, 18 Feb 2024 20:28:49 +0100 Subject: [PATCH] Fix unititialized booleans --- src/qt/pivx/addresseswidget.cpp | 2 +- src/qt/pivx/send.cpp | 2 +- src/qt/pivx/sendchangeaddressdialog.cpp | 2 +- src/qt/walletmodel.cpp | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qt/pivx/addresseswidget.cpp b/src/qt/pivx/addresseswidget.cpp index 6057302cff5e9..7573bd2243751 100644 --- a/src/qt/pivx/addresseswidget.cpp +++ b/src/qt/pivx/addresseswidget.cpp @@ -184,7 +184,7 @@ void AddressesWidget::onStoreContactClicked() QString label = ui->lineEditName->text(); QString address = ui->lineEditAddress->text(); - bool isStaking, isExchange, isShield = false; + bool isStaking = false, isExchange = false, isShield = false; auto pivAdd = Standard::DecodeDestination(address.toUtf8().constData(), isStaking, isExchange, isShield); if (!Standard::IsValidDestination(pivAdd)) { diff --git a/src/qt/pivx/send.cpp b/src/qt/pivx/send.cpp index ed13d6a053170..17dff917e8a4a 100644 --- a/src/qt/pivx/send.cpp +++ b/src/qt/pivx/send.cpp @@ -906,7 +906,7 @@ void SendWidget::onContactMultiClicked() return; } - bool isStaking, isExchange, isShielded = false; + bool isStaking = false, isExchange = false, isShielded = false; auto pivAdd = Standard::DecodeDestination(address.toStdString(), isStaking, isExchange, isShielded); if (!Standard::IsValidDestination(pivAdd) || isStaking) { diff --git a/src/qt/pivx/sendchangeaddressdialog.cpp b/src/qt/pivx/sendchangeaddressdialog.cpp index 7225e159e3abb..63ecb7cec317f 100644 --- a/src/qt/pivx/sendchangeaddressdialog.cpp +++ b/src/qt/pivx/sendchangeaddressdialog.cpp @@ -73,7 +73,7 @@ void SendChangeAddressDialog::accept() QDialog::accept(); } else { // validate address - bool isStaking, isExchange, isShielded = false; + bool isStaking = false, isExchange = false, isShielded = false; dest = Standard::DecodeDestination(ui->lineEditAddress->text().toStdString(), isStaking, isExchange, isShielded); if (!Standard::IsValidDestination(dest)) { diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 3c77b23ef5cf0..86818c6cd1d08 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -399,7 +399,7 @@ void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly) bool WalletModel::validateAddress(const QString& address) { // Only regular base58 addresses and shielded addresses accepted here - bool isStaking, isExchange = false; + bool isStaking = false, isExchange = false; CWDestination dest = Standard::DecodeDestination(address.toStdString(), isStaking, isExchange); const auto regDest = boost::get(&dest); if (regDest && IsValidDestination(*regDest) && isStaking) return false; @@ -413,7 +413,7 @@ bool WalletModel::validateAddress(const QString& address, bool fStaking) bool WalletModel::validateAddress(const QString& address, bool fStaking, bool& isShielded) { - bool isStaking, isExchange = false; + bool isStaking = false, isExchange = false; CWDestination dest = Standard::DecodeDestination(address.toStdString(), isStaking, isExchange); if (IsShieldedDestination(dest)) { isShielded = true; @@ -596,7 +596,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction& tran for (const SendCoinsRecipient& rcp : transaction.getRecipients()) { // Don't touch the address book when we have a payment request { - bool isStaking, isExchange, isShielded = false; + bool isStaking = false, isExchange = false, isShielded = false; auto address = Standard::DecodeDestination(rcp.address.toStdString(), isStaking, isExchange, isShielded); std::string purpose = isShielded ? AddressBook::AddressBookPurpose::SHIELDED_SEND : isStaking ? AddressBook::AddressBookPurpose::COLD_STAKING_SEND : AddressBook::AddressBookPurpose::SEND; @@ -942,7 +942,7 @@ int64_t WalletModel::getKeyCreationTime(const CTxDestination& address) int64_t WalletModel::getKeyCreationTime(const std::string& address) { - bool isStaking, isExchange, isShielded = false; + bool isStaking = false, isExchange = false, isShielded = false; return wallet->GetKeyCreationTime(Standard::DecodeDestination(address, isStaking, isExchange, isShielded)); } @@ -985,7 +985,7 @@ bool WalletModel::blacklistAddressFromColdStaking(const QString &addressStr) bool WalletModel::updateAddressBookPurpose(const QString &addressStr, const std::string& purpose) { - bool isStaking, isExchange = false; + bool isStaking = false, isExchange = false; CTxDestination address = DecodeDestination(addressStr.toStdString(), isStaking, isExchange); if (isStaking) return error("Invalid PIVX address, cold staking address");