diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 3a5f803506..c06dc3226b 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -417,6 +417,9 @@ RES_ICONS = \ qt/res/icons/img-start-logo@2x.png \ qt/res/icons/ic-watch-off@2x.png \ qt/res/icons/ic-switch-on.png \ + qt/res/icons/ic-switch-on-grey.png \ + qt/res/icons/ic-switch-on-grey@2x.png \ + qt/res/icons/ic-switch-on-grey@3x.png \ qt/res/icons/ic-progress-4-10@2x.png \ qt/res/icons/ic-progress-10-10.png \ qt/res/icons/ic-copy@3x.png \ @@ -552,6 +555,9 @@ RES_ICONS = \ qt/res/icons/ic-progress-6-6-complete-14x14.png \ qt/res/icons/ic-switch-on.png \ qt/res/icons/ic-switch-off.png \ + qt/res/icons/ic-switch-off-blue.png \ + qt/res/icons/ic-switch-off-blue@2x.png \ + qt/res/icons/ic-switch-off-blue@3x.png \ qt/res/icons/ic-addresses.png \ qt/res/icons/ic-transactions.png \ qt/res/icons/ic-send.png \ diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 1b2d4bbdee..4f089c97db 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -307,6 +307,7 @@ class WalletImpl : public Wallet } void setStakingEnabled(bool fEnableStaking) override { m_wallet.SetStakingEnabled(fEnableStaking); } bool isStakingEnabled() override { return m_wallet.IsStakingEnabled(); } + bool isStakingActive() override { return m_wallet.IsStakingActive(); } void abortRescan() override { m_wallet.AbortRescan(); } bool backupWallet(const std::string& filename) override { return m_wallet.BackupWallet(filename); } diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 6169026000..d310518c73 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -302,6 +302,9 @@ class Wallet virtual void setStakingEnabled(bool fEnableStaking) = 0; virtual bool isStakingEnabled() = 0; + //! Return whether wallet is actively staking. + virtual bool isStakingActive() = 0; + //! Register handler for unload message. using UnloadFn = std::function; virtual std::unique_ptr handleUnload(UnloadFn fn) = 0; diff --git a/src/miner.cpp b/src/miner.cpp index d7fae20eba..a7516f1c9b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -898,6 +898,7 @@ void BitcoinMiner(std::shared_ptr coinbaseScript, bool fProofOfS } if (!pwallet || !pwallet->IsStakingEnabled() || (pwallet->IsLocked() && !pwallet->IsUnlockedForStakingOnly())) { + mapHashedBlocks.clear(); MilliSleep(5000); continue; } @@ -1213,7 +1214,7 @@ void ThreadStakeMiner() LogPrintf("%s: interrupted\n", __func__); } } - + mapHashedBlocks.clear(); LogPrintf("%s: exiting\n", __func__); } diff --git a/src/qt/res/css/main.css b/src/qt/res/css/main.css index e824ed6ad6..be72c7cbd4 100644 --- a/src/qt/res/css/main.css +++ b/src/qt/res/css/main.css @@ -698,19 +698,6 @@ QCheckBox#checkStaking::indicator { height:25px; } -QCheckBox#checkStaking { - background-image: url(":/icons/ic-switch-off-png"); - background-repeat:no-repeat; - background-position:left center; - color:#bababa; - margin-right:5px; -} - -QCheckBox#checkStaking:checked { - background-image: url(":/icons/ic-switch-on-png"); - color:#105aef; -} - QPushButton#btnSync{ color:#707070; border:none; diff --git a/src/qt/res/icons/ic-switch-off-blue.png b/src/qt/res/icons/ic-switch-off-blue.png new file mode 100644 index 0000000000..e20fddac57 Binary files /dev/null and b/src/qt/res/icons/ic-switch-off-blue.png differ diff --git a/src/qt/res/icons/ic-switch-off-blue.svg b/src/qt/res/icons/ic-switch-off-blue.svg new file mode 100644 index 0000000000..19acd9006e --- /dev/null +++ b/src/qt/res/icons/ic-switch-off-blue.svg @@ -0,0 +1,80 @@ + + + + + + image/svg+xml + + ic-switch-on + + + + + + + ic-switch-on + Created with Sketch. + + + + + + + + + diff --git a/src/qt/res/icons/ic-switch-off-blue@2x.png b/src/qt/res/icons/ic-switch-off-blue@2x.png new file mode 100644 index 0000000000..cb79a15995 Binary files /dev/null and b/src/qt/res/icons/ic-switch-off-blue@2x.png differ diff --git a/src/qt/res/icons/ic-switch-off-blue@3x.png b/src/qt/res/icons/ic-switch-off-blue@3x.png new file mode 100644 index 0000000000..80aa0882e5 Binary files /dev/null and b/src/qt/res/icons/ic-switch-off-blue@3x.png differ diff --git a/src/qt/res/icons/ic-switch-off.png b/src/qt/res/icons/ic-switch-off.png index 1c72aa480d..5f75e33db9 100644 Binary files a/src/qt/res/icons/ic-switch-off.png and b/src/qt/res/icons/ic-switch-off.png differ diff --git a/src/qt/res/icons/ic-switch-off.svg b/src/qt/res/icons/ic-switch-off.svg index 5a355d0bea..43a0bd7e5b 100644 --- a/src/qt/res/icons/ic-switch-off.svg +++ b/src/qt/res/icons/ic-switch-off.svg @@ -1,14 +1,88 @@ - - - - ic-switch-off - Created with Sketch. - - - - - - - + + + + + + image/svg+xml + + ic-switch-on + + + + + + + ic-switch-on + Created with Sketch. + + + + + + - \ No newline at end of file + + diff --git a/src/qt/res/icons/ic-switch-off@2x.png b/src/qt/res/icons/ic-switch-off@2x.png index 6798e73579..0e8791224f 100644 Binary files a/src/qt/res/icons/ic-switch-off@2x.png and b/src/qt/res/icons/ic-switch-off@2x.png differ diff --git a/src/qt/res/icons/ic-switch-off@3x.png b/src/qt/res/icons/ic-switch-off@3x.png index a5b7a6b1d6..d09c47a5aa 100644 Binary files a/src/qt/res/icons/ic-switch-off@3x.png and b/src/qt/res/icons/ic-switch-off@3x.png differ diff --git a/src/qt/res/icons/ic-switch-on-grey.png b/src/qt/res/icons/ic-switch-on-grey.png new file mode 100644 index 0000000000..bc47242946 Binary files /dev/null and b/src/qt/res/icons/ic-switch-on-grey.png differ diff --git a/src/qt/res/icons/ic-switch-on-grey.svg b/src/qt/res/icons/ic-switch-on-grey.svg new file mode 100644 index 0000000000..32ef169965 --- /dev/null +++ b/src/qt/res/icons/ic-switch-on-grey.svg @@ -0,0 +1,88 @@ + + + + + + image/svg+xml + + ic-switch-on + + + + + + + ic-switch-on + Created with Sketch. + + + + + + + + + diff --git a/src/qt/res/icons/ic-switch-on-grey@2x.png b/src/qt/res/icons/ic-switch-on-grey@2x.png new file mode 100644 index 0000000000..3e6caced01 Binary files /dev/null and b/src/qt/res/icons/ic-switch-on-grey@2x.png differ diff --git a/src/qt/res/icons/ic-switch-on-grey@3x.png b/src/qt/res/icons/ic-switch-on-grey@3x.png new file mode 100644 index 0000000000..b7875a1ab4 Binary files /dev/null and b/src/qt/res/icons/ic-switch-on-grey@3x.png differ diff --git a/src/qt/res/icons/ic-switch-on.png b/src/qt/res/icons/ic-switch-on.png index f0375655d0..e6f67b466c 100644 Binary files a/src/qt/res/icons/ic-switch-on.png and b/src/qt/res/icons/ic-switch-on.png differ diff --git a/src/qt/res/icons/ic-switch-on.svg b/src/qt/res/icons/ic-switch-on.svg index f2136d0d16..52c2b3b364 100644 --- a/src/qt/res/icons/ic-switch-on.svg +++ b/src/qt/res/icons/ic-switch-on.svg @@ -1,14 +1,83 @@ - - - - ic-switch-on - Created with Sketch. - - - - - - - + + + + + + image/svg+xml + + ic-switch-on + + + + + + + ic-switch-on + Created with Sketch. + + + + + + - \ No newline at end of file + + diff --git a/src/qt/res/icons/ic-switch-on@2x.png b/src/qt/res/icons/ic-switch-on@2x.png index e29d42b5d7..65a591818c 100644 Binary files a/src/qt/res/icons/ic-switch-on@2x.png and b/src/qt/res/icons/ic-switch-on@2x.png differ diff --git a/src/qt/res/icons/ic-switch-on@3x.png b/src/qt/res/icons/ic-switch-on@3x.png index 6332f6313e..b6ccb94176 100644 Binary files a/src/qt/res/icons/ic-switch-on@3x.png and b/src/qt/res/icons/ic-switch-on@3x.png differ diff --git a/src/qt/veil.qrc b/src/qt/veil.qrc index 9f63eb1815..52c306c6fa 100644 --- a/src/qt/veil.qrc +++ b/src/qt/veil.qrc @@ -259,7 +259,9 @@ res/icons/ic-receive.png res/icons/ic-send.png res/icons/ic-switch-off.png + res/icons/ic-switch-off-blue.png res/icons/ic-switch-on.png + res/icons/ic-switch-on-grey.png res/icons/ic-transactions.png res/icons/ic-addresses.png res/icons/ic-progress-6-6-complete-14x14.png diff --git a/src/qt/veil/forms/settingswidget.ui b/src/qt/veil/forms/settingswidget.ui index 93fc8f2767..31492561b8 100644 --- a/src/qt/veil/forms/settingswidget.ui +++ b/src/qt/veil/forms/settingswidget.ui @@ -254,7 +254,7 @@ border:0; 5 - 5 + 0 diff --git a/src/qt/veil/veilstatusbar.cpp b/src/qt/veil/veilstatusbar.cpp index 4d985f365b..e4ad8199f7 100644 --- a/src/qt/veil/veilstatusbar.cpp +++ b/src/qt/veil/veilstatusbar.cpp @@ -15,6 +15,12 @@ #include // For DEFAULT_DISABLE_WALLET #endif +QString toggleOnBlue = "QCheckBox {background-image: url(':/icons/ic-switch-on-png'); background-repeat:no-repeat; background-position:left center; color:#105aef; margin-right:5px;}"; +QString toggleOnGrey = "QCheckBox {background-image: url(':/icons/ic-switch-on-grey-png'); background-repeat:no-repeat; background-position:left center; color:#bababa; margin-right:5px;}"; +QString toggleOffGrey = "QCheckBox {background-image: url(':/icons/ic-switch-off-png'); background-repeat:no-repeat; background-position:left center; color:#bababa; margin-right:5px;}"; +QString toggleOffBlue = "QCheckBox {background-image: url(':/icons/ic-switch-off-blue-png'); background-repeat:no-repeat; background-position:left center; color:#105aef; margin-right:5px;}"; + + VeilStatusBar::VeilStatusBar(QWidget *parent, BitcoinGUI* gui) : QWidget(parent), ui(new Ui::VeilStatusBar), @@ -22,6 +28,8 @@ VeilStatusBar::VeilStatusBar(QWidget *parent, BitcoinGUI* gui) : { ui->setupUi(this); + stakingTextUpdateTimer = new QTimer(this); + connect(stakingTextUpdateTimer, SIGNAL(timeout()), this, SLOT(setStakingText())); connect(ui->btnSync, SIGNAL(clicked()), this, SLOT(onBtnSyncClicked())); connect(ui->btnSyncIndicator, SIGNAL(clicked()), this, SLOT(onBtnSyncClicked())); #ifdef ENABLE_WALLET @@ -62,48 +70,55 @@ void VeilStatusBar::onBtnSyncClicked(){ #ifdef ENABLE_WALLET bool fBlockNextStakeCheckSignal = false; void VeilStatusBar::setStakingText() { + stakingTextUpdateTimer->stop(); + + auto pwallet = GetMainWallet(); + + bool fStakingActive = pwallet->IsStakingActive(); - // Determine if staking is recently active. Note that this is not immediate effect. Staking could be disabled and it could take some time (activeStakingMaxTime) update state. - int64_t nTimeLastHashing = 0; - if (!mapHashedBlocks.empty()) { - auto pindexBest = chainActive.Tip(); - if (mapHashedBlocks.count(pindexBest->GetBlockHash())) { - nTimeLastHashing = mapHashedBlocks.at(pindexBest->GetBlockHash()); - } else if (mapHashedBlocks.count(pindexBest->pprev->GetBlockHash())) { - nTimeLastHashing = mapHashedBlocks.at(pindexBest->pprev->GetBlockHash()); - } - } - bool fStakingActive = false; - if (nTimeLastHashing) - fStakingActive = GetAdjustedTime() + MAX_FUTURE_BLOCK_TIME - nTimeLastHashing < ACTIVE_STAKING_MAX_TIME; - WalletModel::EncryptionStatus eStatus = this->walletModel->getEncryptionStatus(); if (syncFlag){ - ui->checkStaking->setText("Staking Disabled while Syncing"); + ui->checkStaking->setText("Staking Disabled while Syncing"); + ui->checkStaking->setStyleSheet(toggleOffGrey); }else if (WalletModel::Locked == eStatus) { ui->checkStaking->setText("Unlock wallet for Staking"); + ui->checkStaking->setStyleSheet(toggleOffGrey); }else if (this->walletModel->isStakingEnabled()) { - if (fStakingActive) { - ui->checkStaking->setText("Staking Enabled"); - }else{ - - interfaces::Wallet& wallet = walletModel->wallet(); - interfaces::WalletBalances balances = wallet.getBalances(); - int64_t zerocoin_balance = balances.zerocoin_balance; - - if (0.0 < zerocoin_balance) { - ui->checkStaking->setText("Enabling..."); - }else{ - ui->checkStaking->setText("You need some zerocoin"); - } - } + if (fStakingActive) { + ui->checkStaking->setText("Staking Enabled"); + ui->checkStaking->setStyleSheet(toggleOnBlue); + }else{ + CAmount confirmationsRemaining = pwallet->GetZTrackerPointer()->GetConfirmationsRemainingForStaking(); + if (confirmationsRemaining >=0) { + if(confirmationsRemaining == 0){ + stakingTextUpdateTimer->start(5000); + ui->checkStaking->setText("Enabling..."); + } + else{ + QString str; + LogPrintf("%s: Waiting on %d confirmations for staking\n", __func__, confirmationsRemaining); + ui->checkStaking->setText("Staking requires " + str.setNum(confirmationsRemaining) + " more confirmations"); + } + }else{ + if(confirmationsRemaining == -1){ + ui->checkStaking->setText("You need some zerocoin in order to stake"); + } + else if(confirmationsRemaining == -2){ + ui->checkStaking->setText("Fetching zerocoin status..."); + } + } + ui->checkStaking->setStyleSheet(toggleOnGrey); + } }else{ - if (fStakingActive) { - ui->checkStaking->setText("Disabling..."); - }else{ - ui->checkStaking->setText("Staking Disabled"); - } + if (fStakingActive) { + stakingTextUpdateTimer->start(5000); + ui->checkStaking->setText("Disabling..."); + ui->checkStaking->setStyleSheet(toggleOffBlue); + }else{ + ui->checkStaking->setText("Staking Disabled"); + ui->checkStaking->setStyleSheet(toggleOffGrey); + } } } @@ -119,27 +134,26 @@ void VeilStatusBar::onCheckStakingClicked(bool res) { // Miner thread starts in init.cpp, but staking enabled flag is checked each iteration of the miner, so can be enabled or disabled here WalletModel::EncryptionStatus lockState = walletModel->getEncryptionStatus(); - if (res){ - if (gArgs.GetBoolArg("-exchangesandservicesmode", false) || lockState == WalletModel::Locked) { - QString dialogMsg = gArgs.GetBoolArg("-exchangesandservicesmode", false) ? "Staking is disabled in exchange mode" : "Must unlock wallet before staking can be enabled"; - openToastDialog(dialogMsg, mainWindow); - fBlockNextStakeCheckSignal = true; - ui->checkStaking->setChecked(false); - setStakingText(); - return; - }else{ - this->walletModel->setStakingEnabled(true); - mainWindow->updateWalletStatus(); - openToastDialog("Staking enabled", mainWindow); - setStakingText(); - } - } else { - this->walletModel->setStakingEnabled(false); - mainWindow->updateWalletStatus(); - openToastDialog("Staking disabled - this may take a few minutes", mainWindow); - setStakingText(); - } - + if (gArgs.GetBoolArg("-exchangesandservicesmode", false) || lockState == WalletModel::Locked) { + QString dialogMsg = gArgs.GetBoolArg("-exchangesandservicesmode", false) ? "Staking is disabled in exchange mode" : "Must unlock wallet before staking can be enabled"; + openToastDialog(dialogMsg, mainWindow); + fBlockNextStakeCheckSignal = true; + ui->checkStaking->setChecked(false); + setStakingText(); + return; + }else{ + if(!this->walletModel->isStakingEnabled()){ + this->walletModel->setStakingEnabled(true); + mainWindow->updateWalletStatus(); + openToastDialog("Enabling staking - this may take a few minutes", mainWindow); + setStakingText(); + }else { + this->walletModel->setStakingEnabled(false); + mainWindow->updateWalletStatus(); + openToastDialog("Disabling staking - this may take a few minutes", mainWindow); + setStakingText(); + } + } } bool fBlockNextBtnLockSignal = false; @@ -247,7 +261,10 @@ void VeilStatusBar::updateStakingCheckbox() ui->checkStaking->setEnabled(!syncFlag); setStakingText(); - bool stakingStatus = walletModel->isStakingEnabled() && lockState != WalletModel::Locked && !syncFlag; + auto pwallet = GetMainWallet(); + CAmount confirmationsRemaining = pwallet->GetZTrackerPointer()->GetConfirmationsRemainingForStaking(); + + bool stakingStatus = !mapHashedBlocks.empty() && confirmationsRemaining == 0 && lockState != WalletModel::Locked && !syncFlag; if (ui->checkStaking->isChecked() != stakingStatus) { fBlockNextStakeCheckSignal = true; ui->checkStaking->setChecked(stakingStatus); diff --git a/src/qt/veil/veilstatusbar.h b/src/qt/veil/veilstatusbar.h index bc9141aa14..e11c6b922a 100644 --- a/src/qt/veil/veilstatusbar.h +++ b/src/qt/veil/veilstatusbar.h @@ -7,6 +7,7 @@ #include #include +#include #include #include "unlockpassworddialog.h" @@ -41,6 +42,7 @@ class VeilStatusBar : public QWidget private Q_SLOTS: void onBtnSyncClicked(); #ifdef ENABLE_WALLET + void setStakingText(); void onBtnLockClicked(); void onCheckStakingClicked(bool res); void updateLockCheckbox(); @@ -52,9 +54,7 @@ private Q_SLOTS: WalletModel *walletModel = nullptr; ClientModel *clientModel = nullptr; UnlockPasswordDialog *unlockPasswordDialog = nullptr; -#ifdef ENABLE_WALLET - void setStakingText(); -#endif + QTimer* stakingTextUpdateTimer; bool preparingFlag = false; bool syncFlag = true; diff --git a/src/veil/zerocoin/ztracker.cpp b/src/veil/zerocoin/ztracker.cpp index c64669854e..29a1c588c0 100644 --- a/src/veil/zerocoin/ztracker.cpp +++ b/src/veil/zerocoin/ztracker.cpp @@ -167,6 +167,39 @@ CAmount CzTracker::GetUnconfirmedBalance() const return GetBalance(false, true); } +CAmount CzTracker::GetConfirmationsRemainingForStaking() const +{ + //zerocoin database entries not loaded yet + if(!fInitialized) + return -2; + + CAmount maxMintConfirmations = -1; + + //find max confirmations + for (auto& it : mapSerialHashes) { + CMintMeta mint = it.second; + if (mint.nVersion < CZerocoinMint::STAKABLE_VERSION) + continue; + if (mint.isUsed || mint.isArchived || mint.nHeight <= 0) + continue; + + int mintConfirmations = chainActive.Height() - mint.nHeight; + + //mature zerocoin available for staking + if(Params().Zerocoin_RequiredStakeDepthV2() - mintConfirmations <= 0) + return 0; + if(mintConfirmations > maxMintConfirmations) + maxMintConfirmations = mintConfirmations; + } + + //no stakable zerocoin in wallet + if(maxMintConfirmations == -1) + return -1; + + //confirmations remaining + return Params().Zerocoin_RequiredStakeDepthV2() - maxMintConfirmations; +} + std::vector CzTracker::GetMints(bool fConfirmedOnly) const { vector vMints; diff --git a/src/veil/zerocoin/ztracker.h b/src/veil/zerocoin/ztracker.h index 5a171e8f44..5eeb648bfb 100644 --- a/src/veil/zerocoin/ztracker.h +++ b/src/veil/zerocoin/ztracker.h @@ -45,6 +45,7 @@ class CzTracker std::vector GetSerialHashes(); std::vector GetMints(bool fConfirmedOnly) const; CAmount GetUnconfirmedBalance() const; + CAmount GetConfirmationsRemainingForStaking() const; std::set ListMints(bool fUnusedOnly, bool fMatureOnly, bool fUpdateStatus); void RemovePending(const uint256& txid); void SetPubcoinUsed(const PubCoinHash& hashPubcoin, const uint256& txid); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 7533c2a370..d44fb27f7f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3430,21 +3430,7 @@ static UniValue getwalletinfo(const JSONRPCRequest& request) obj.pushKV("staking_enabled", pwallet->IsStakingEnabled()); - // Determine if staking is recently active. Note that this is not immediate effect. Staking could be disabled and it could take up to 70 seconds to update state. - int64_t nTimeLastHashing = 0; - if (!mapHashedBlocks.empty()) { - auto pindexBest = chainActive.Tip(); - if (mapHashedBlocks.count(pindexBest->GetBlockHash())) { - nTimeLastHashing = mapHashedBlocks.at(pindexBest->GetBlockHash()); - } else if (mapHashedBlocks.count(pindexBest->pprev->GetBlockHash())) { - nTimeLastHashing = mapHashedBlocks.at(pindexBest->pprev->GetBlockHash()); - } - } - bool fStakingActive = false; - if (nTimeLastHashing) - fStakingActive = GetAdjustedTime() + MAX_FUTURE_BLOCK_TIME - nTimeLastHashing < 70; - - obj.pushKV("staking_active", fStakingActive); + obj.pushKV("staking_active", pwallet->IsStakingActive()); UniValue objSeedData(UniValue::VOBJ); auto pAnonWallet = pwallet->GetAnonWallet(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1fdb177429..23787b9055 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4007,6 +4007,13 @@ bool CWallet::SelectStakeCoins(std::list >& listI listInputs.emplace_back(std::move(input)); } } + if(!listInputs.empty()){ + fHasStakableInputs = true; + } + else{ + fHasStakableInputs = false; + mapHashedBlocks.clear(); + } LogPrint(BCLog::BLOCKCREATION, "%s: FOUND %d STAKABLE ZEROCOINS\n", __func__, listInputs.size()); @@ -4749,6 +4756,11 @@ void CWallet::ListLockedCoins(std::vector& vOutpts) const } } +bool CWallet::IsStakingActive() +{ + return fHasStakableInputs && !mapHashedBlocks.empty(); +} + /** @} */ // end of Actions void CWallet::GetKeyBirthTimes(std::map &mapKeyBirth) const { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 6eb34523e9..ad3fb15781 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -689,6 +689,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface std::unique_ptr zTracker; bool fUnlockForStakingOnly = false; bool fStakingEnabled = true; + bool fHasStakableInputs = false; WalletBatch *encrypted_batch = nullptr; @@ -981,6 +982,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface bool IsUnlockedForStakingOnly() const { return fUnlockForStakingOnly; } void SetStakingEnabled(bool fStakingEnabled) { this->fStakingEnabled = fStakingEnabled; } bool IsStakingEnabled() const { return fStakingEnabled; } + bool IsStakingActive(); /* * Rescan abort properties