Skip to content

Commit 07b981a

Browse files
committed
no time validation for regtest
1 parent 47c2c65 commit 07b981a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/kernel.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,15 @@ bool CheckStake(const CDataStream& ssUniqueID, CAmount nValueIn, const uint64_t
300300

301301
bool Stake(CStakeInput* stakeInput, unsigned int nBits, unsigned int nTimeBlockFrom, unsigned int& nTimeTx, uint256& hashProofOfStake)
302302
{
303-
if (nTimeTx < nTimeBlockFrom)
304-
return error("CheckStakeKernelHash() : nTime violation");
303+
if(Params().NetworkID() != CBaseChainParams::REGTEST) {
304+
if (nTimeTx < nTimeBlockFrom)
305+
return error("CheckStakeKernelHash() : nTime violation");
305306

306-
if ((nTimeBlockFrom + nStakeMinAge > nTimeTx) && Params().NetworkID() != CBaseChainParams::REGTEST) // Min age requirement
307-
return error("CheckStakeKernelHash() : min age violation - nTimeBlockFrom=%d nStakeMinAge=%d nTimeTx=%d",
308-
nTimeBlockFrom, nStakeMinAge, nTimeTx);
307+
if ((nTimeBlockFrom + nStakeMinAge > nTimeTx)) // Min age requirement
308+
return error("CheckStakeKernelHash() : min age violation - nTimeBlockFrom=%d nStakeMinAge=%d nTimeTx=%d",
309+
nTimeBlockFrom, nStakeMinAge, nTimeTx);
310+
311+
}
309312

310313
//grab difficulty
311314
uint256 bnTargetPerCoinDay;

0 commit comments

Comments
 (0)