@@ -1070,7 +1070,9 @@ MiningCPID GetNextProject(bool bForce)
1070
1070
uint256 pbh = 1 ;
1071
1071
GlobalCPUMiningCPID.cpidv2 = ComputeCPIDv2 (GlobalCPUMiningCPID.email ,GlobalCPUMiningCPID.boincruntimepublickey , pbh);
1072
1072
GlobalCPUMiningCPID.lastblockhash = " 0" ;
1073
-
1073
+ // Sign the block
1074
+ GlobalCPUMiningCPID.BoincSignature = SignBlockWithCPID (GlobalCPUMiningCPID.cpid ,GlobalCPUMiningCPID.lastblockhash );
1075
+
1074
1076
if (!IsCPIDValidv2 (GlobalCPUMiningCPID,1 ))
1075
1077
{
1076
1078
printf (" CPID INVALID 2 %s, %s " ,GlobalCPUMiningCPID.cpid .c_str (),GlobalCPUMiningCPID.cpidv2 .c_str ());
@@ -3522,7 +3524,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck, boo
3522
3524
pindex->nMoneySupply = ReturnCurrentMoneySupply (pindex) + nValueOut - nValueIn;
3523
3525
3524
3526
// Gridcoin: Store verified magnitude and CPID in block index (7-11-2015)
3525
- if (pindex->nHeight > nNewIndex )
3527
+ if (pindex->nHeight > nNewIndex2 )
3526
3528
{
3527
3529
pindex->sCPID = bb.cpid ;
3528
3530
pindex->nMagnitude = bb.Magnitude ;
@@ -3708,7 +3710,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck, boo
3708
3710
// End of Network Consensus
3709
3711
3710
3712
// Gridcoin: Track payments to CPID, and last block paid
3711
- if (!bb.cpid .empty () && bb.cpid != " INVESTOR" && pindex->nHeight > nNewIndex )
3713
+ if (!bb.cpid .empty () && bb.cpid != " INVESTOR" && pindex->nHeight > nNewIndex2 )
3712
3714
{
3713
3715
StructCPID stCPID = GetInitializedStructCPID2 (bb.cpid ,mvResearchAge);
3714
3716
stCPID.InterestSubsidy += bb.InterestSubsidy ;
@@ -4487,7 +4489,7 @@ bool CBlock::CheckBlock(std::string sCaller, int height1, int64_t Mint, bool fCh
4487
4489
if (fDebug10 ) printf (" BV %f, CV %f " ,bv,cvn);
4488
4490
// if (bv+10 < cvn) return error("ConnectBlock[]: Old client version after mandatory upgrade - block rejected\r\n");
4489
4491
if (bv < 3517 && IsResearchAgeEnabled (height1) && !fTestNet ) return error (" CheckBlock[]: Old client spamming new blocks after mandatory upgrade \r\n " );
4490
- if (bv < 3578 && fTestNet ) return DoS (25 , error (" CheckBlock[]: Old testnet client spamming new blocks after mandatory upgrade \r\n " ));
4492
+ if (bv < 3579 && fTestNet ) return DoS (25 , error (" CheckBlock[]: Old testnet client spamming new blocks after mandatory upgrade \r\n " ));
4491
4493
}
4492
4494
4493
4495
if (bb.cpid != " INVESTOR" && height1 > nGrandfather)
@@ -5063,9 +5065,8 @@ void GridcoinServices()
5063
5065
5064
5066
bool AskForOutstandingBlocks (uint256 hashStart)
5065
5067
{
5066
- if (! fTestNet && IsLockTimeWithinMinutes (nLastAskedForBlocks,2 )) return true ;
5068
+ if (IsLockTimeWithinMinutes (nLastAskedForBlocks,2 )) return true ;
5067
5069
nLastAskedForBlocks = GetAdjustedTime ();
5068
- if (fTestNet ) mapAlreadyAskedFor.clear ();
5069
5070
5070
5071
int iAsked = 0 ;
5071
5072
LOCK (cs_vNodes);
@@ -5538,7 +5539,7 @@ bool LoadBlockIndex(bool fAllowNew)
5538
5539
bnProofOfWorkLimit = bnProofOfWorkLimitTestNet; // 16 bits PoW target limit for testnet
5539
5540
nStakeMinAge = 1 * 60 * 60 ; // test net min age is 1 hour
5540
5541
nCoinbaseMaturity = 10 ; // test maturity is 10 blocks
5541
- nGrandfather = 195500 ;
5542
+ nGrandfather = 196300 ;
5542
5543
nNewIndex = 10 ;
5543
5544
nNewIndex2 = 36500 ;
5544
5545
bRemotePaymentsEnabled = false ;
@@ -5951,7 +5952,7 @@ bool IsCPIDValidv2(MiningCPID& mc, int height)
5951
5952
if (height < nGrandfather) return true ;
5952
5953
bool result = false ;
5953
5954
int cpidV2CutOverHeight = fTestNet ? 0 : 97000 ;
5954
- int cpidV3CutOverHeight = fTestNet ? 195500 : 700000 ;
5955
+ int cpidV3CutOverHeight = fTestNet ? 196300 : 705000 ;
5955
5956
if (height < cpidV2CutOverHeight)
5956
5957
{
5957
5958
result = IsCPIDValid_Retired (mc.cpid ,mc.enccpid );
@@ -7332,7 +7333,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
7332
7333
7333
7334
7334
7335
// Ensure testnet users are running latest version as of 12-3-2015 (works in conjunction with block spamming)
7335
- if (pfrom->nVersion < 180319 && fTestNet )
7336
+ if (pfrom->nVersion < 180320 && fTestNet )
7336
7337
{
7337
7338
// disconnect from peers older than this proto version
7338
7339
if (fDebug10 ) printf (" Testnet partner %s using obsolete version %i; disconnecting\n " , pfrom->addr .ToString ().c_str (), pfrom->nVersion );
@@ -10261,7 +10262,7 @@ void TestScan()
10261
10262
BOOST_FOREACH (const PAIRTYPE (uint256, CBlockIndex*)& item, mapBlockIndex)
10262
10263
{
10263
10264
CBlockIndex* pindex = item.second ;
10264
- if (LessVerbose (1 ) || pindex->nHeight > nNewIndex )
10265
+ if (LessVerbose (1 ) || pindex->nHeight > nNewIndex2 )
10265
10266
{
10266
10267
printf (" map block index h %f , cpid %s , Mag %f , RS %f, INT %f \r\n " ,(double )pindex->nHeight ,pindex->sCPID .c_str (), (double )pindex->nMagnitude ,
10267
10268
pindex->nResearchSubsidy ,pindex->nInterestSubsidy );
@@ -10276,7 +10277,7 @@ void TestScan2()
10276
10277
while (pindex->nHeight > 1 )
10277
10278
{
10278
10279
pindex = pindex->pprev ;
10279
- if (LessVerbose (1 ) || pindex->nHeight > nNewIndex )
10280
+ if (LessVerbose (1 ) || pindex->nHeight > nNewIndex2 )
10280
10281
{
10281
10282
printf (" map block index h %f , cpid %s , Mag %f , RS %f, INT %f \r\n " ,(double )pindex->nHeight ,pindex->sCPID .c_str (), (double )pindex->nMagnitude ,
10282
10283
pindex->nResearchSubsidy ,pindex->nInterestSubsidy );
@@ -10437,7 +10438,7 @@ CBlockIndex* GetHistoricalMagnitude_ScanChain(std::string cpid)
10437
10438
// Limit lookback to 6 months
10438
10439
int nMinIndex = pindexBest->nHeight -(6 *30 *BLOCKS_PER_DAY);
10439
10440
if (nMinIndex < 2 ) nMinIndex=2 ;
10440
- while (pindex->nHeight > nNewIndex && pindex->nHeight > nMinIndex)
10441
+ while (pindex->nHeight > nNewIndex2 && pindex->nHeight > nMinIndex)
10441
10442
{
10442
10443
// 8-5-2015; R HALFORD; Find the last block the CPID staked with a research subsidy (IE dont count interest blocks)
10443
10444
if (!pindex || !pindex->pprev ) return pindexGenesisBlock;
0 commit comments