Skip to content

Commit

Permalink
show number of confirmations remaining for staking to be active
Browse files Browse the repository at this point in the history
enhancements
cleanup
rename min to max
wording and spelling
more UI enhancements/ edge case support
better staking status alignment
color indicates wallet status. toggle indicates intent.
new icons (needs resizing and fixing up)
small change for code reduction and clarity
make it more readable
additional check borrowed from MintableCoins(). less than equals sanity
svg and png toggle standardizations. move QString to top.
adjust offset with adjusted icon
create common shared IsStakingActive code in wallet.cpp
log print removal cleanup. qt makefile additions
IsStakingActive() check now leverages mining check for stakable inputs
clear mapHashedBlocks when staking thread exits
  • Loading branch information
Rock-N-Troll authored and Rock-N-Troll committed Apr 5, 2021
1 parent e55a309 commit d9baa2d
Show file tree
Hide file tree
Showing 29 changed files with 460 additions and 96 deletions.
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();
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

0 comments on commit d9baa2d

Please sign in to comment.