I think "timestamp too early" problem is PoS problem. So Bitcoin won't be affected due to this.
From
https://github.com/Earlz/coinreviews/blob/master/miraclecoin.txt:
- double nCorTried = sqrt(nTried) * (100.0 - nUnkBias);
- double nCorNew = sqrt(nNew) * nUnkBias;
+ double nCorTried = sqrt(static_cast(nTried)) * (100.0 - nUnkBias);
+ double nCorNew = sqrt(static_cast(nNew)) * nUnkBias;
- loop
+ INFINITE_LOOP
this is unusual
+unsigned int nStakeMinAge = 0;
+unsigned int nStakeMaxAge = 60 * 60 * 24 * 90; //90d
...wat. Why are the names commented out like that. Sure, it's legal C++ and all.. but why!?
int64 CTransaction::GetMinFee(unsigned int /*nBlockSize*/, bool /*fAllowFree*/,
enum GetMinFee_mode mode, unsigned int /*nBytes*/) const
looks safe but weird that things are moved around. This is probably from being cloned from CLOAK which modified this stuff
@@ -2006,10 +1958,6 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot) const
if (fCheckPOW && IsProofOfWork() && !CheckProofOfWork(GetHash(), nBits))
return DoS(50, error("CheckBlock() : proof of work failed"));
- // Check timestamp
- if (GetBlockTime() > GetAdjustedTime() + nMaxClockDrift)
- return error("CheckBlock() : block timestamp too far in the future");
-
// First transaction must be coinbase, the rest must not be
if (vtx.empty() || !vtx[0].IsCoinBase())
return DoS(100, error("CheckBlock() : first tx is not coinbase"));
@@ -2026,14 +1974,6 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot) const
if (IsProofOfStake() && (vtx[0].vout.size() != 1 || !vtx[0].vout[0].IsEmpty()))
return error("CheckBlock() : coinbase output not empty for proof-of-stake block");
- // Check coinbase timestamp
- if (GetBlockTime() > (int64)vtx[0].nTime + nMaxClockDrift)
- return DoS(50, error("CheckBlock() : coinbase timestamp is too early"));
-
- // Check coinstake timestamp
- if (IsProofOfStake() && !CheckCoinStakeTimestamp(GetBlockTime(), (int64)vtx[1].nTime))
- return DoS(50, error("CheckBlock() : coinstake timestamp violation nTimeBlock=%"PRI64d" nTimeTx=%u", GetBlockTime(), vtx[1].nTime));
-
...
- // Check timestamp against prev
- if (GetBlockTime() <= pindexPrev->GetMedianTimePast() || GetBlockTime() + nMaxClockDrift < pindexPrev->GetBlockTime())
- return error("AcceptBlock() : block's timestamp is too early");
+ // Check timestamp
+ if (GetBlockTime() > GetAdjustedTime() + GetMaxClockDrift(nHeight))
+ return error("AcceptBlock() : block timestamp too far in the future");
+
+ // Check coinbase timestamp
+ if (GetBlockTime() > (int64)vtx[0].nTime + GetMaxClockDrift(nHeight))
+ return DoS(50, error("AcceptBlock() : coinbase timestamp is too early"));
This maybe different from yours but this might help you:
Think that 15 min stake time tolerance might be breaking it (guess you changed the FutureDrift for this - can't verify because the source code does not reflect the most recent change yet).
So with regards to new testers, we might have to include a temporary condition to skip this check for blocks older than a certain threshold. I can play around with this tomorrow when I've got a fresh head and time on my hands.
---
Yep, thats a good catch, I changed the future drift and past drift back to the original 15 mins, when I thought that the kernal coinstake calculation was either empty or invalid, and also the drift seems to affect the mins left to next stake. So that ended up breaking clients who already accepted drifted blocks. Im going to add the grandfather up to 5000 first before I ask everyone to reset the chain and we'll see how this goes...
I did erase my local chain and choked on the same block.... Testing...
NB: I am a newb to these things.