| 970 | } |
| 971 | |
| 972 | bool Stake::IsActive() const { |
| 973 | if (!GetBoolArg("-staking", DEFAULT_STAKE) ) |
| 974 | return false; |
| 975 | |
| 976 | auto const nHeight = chainActive.Tip()->nHeight; |
| 977 | bool nStaking = false; |
| 978 | |
| 979 | if (mapHashedBlocks.count(nHeight)) |
| 980 | nStaking = true; |
| 981 | else if (mapHashedBlocks.count(nHeight - 1) && |
| 982 | HasStaked()) |
| 983 | nStaking = true; |
| 984 | |
| 985 | return nStaking; |
| 986 | } |
| 987 | |
| 988 | bool Stake::SelectStakeCoins(CWallet* wallet, std::set <std::pair<const CWalletTx*, unsigned int>>& stakecoins, const int64_t targetAmount) { |
| 989 | auto const nTime = GetTime(); |
no test coverage detected