Skip to content
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

[Staking][Zerocoin][GUI] Show number of confirmations until staking becomes active #913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ RES_ICONS = \
qt/res/icons/[email protected] \
qt/res/icons/[email protected] \
qt/res/icons/ic-switch-on.png \
qt/res/icons/ic-switch-on-grey.png \
qt/res/icons/[email protected] \
qt/res/icons/[email protected] \
qt/res/icons/[email protected] \
qt/res/icons/ic-progress-10-10.png \
qt/res/icons/[email protected] \
Expand Down Expand Up @@ -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/[email protected] \
qt/res/icons/[email protected] \
qt/res/icons/ic-addresses.png \
qt/res/icons/ic-transactions.png \
qt/res/icons/ic-send.png \
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void()>;
virtual std::unique_ptr<Handler> handleUnload(UnloadFn fn) = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ void BitcoinMiner(std::shared_ptr<CReserveScript> coinbaseScript, bool fProofOfS
}

if (!pwallet || !pwallet->IsStakingEnabled() || (pwallet->IsLocked() && !pwallet->IsUnlockedForStakingOnly())) {
mapHashedBlocks.clear();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT fix the indentation

MilliSleep(5000);
continue;
}
Expand Down Expand Up @@ -1213,7 +1214,7 @@ void ThreadStakeMiner()
LogPrintf("%s: interrupted\n", __func__);
}
}

mapHashedBlocks.clear();
LogPrintf("%s: exiting\n", __func__);
}

Expand Down
13 changes: 0 additions & 13 deletions src/qt/res/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file added src/qt/res/icons/ic-switch-off-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions src/qt/res/icons/ic-switch-off-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/ic-switch-off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 87 additions & 13 deletions src/qt/res/icons/ic-switch-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/qt/res/icons/ic-switch-on-grey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions src/qt/res/icons/ic-switch-on-grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/qt/res/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/ic-switch-on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading