| 908 | } |
| 909 | |
| 910 | bool Stake::IsBlockStaked(int nHeight) const { |
| 911 | auto it = mapHashedBlocks.find(nHeight); |
| 912 | if (it != mapHashedBlocks.end()) { |
| 913 | auto const nStakingInterval=Params().StakingInterval(); |
| 914 | if (nHashInterval < nStakingInterval) { |
| 915 | auto that = const_cast<Stake*>(this); |
| 916 | that->nHashInterval = nStakingInterval; |
| 917 | } |
| 918 | if (GetTime() - it->second < max(nHashInterval, (unsigned int) 1)) { |
| 919 | return true; |
| 920 | } |
| 921 | } |
| 922 | return false; |
| 923 | } |
| 924 | |
| 925 | bool Stake::IsBlockStaked(const CBlock* block) const{ |
| 926 | return block->IsProofOfStake() && mapStakes.find(block->vtx[1].vin[0].prevout) != mapStakes.end(); |
no test coverage detected