-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gridcoin Research 3.5.8.7/MSI=42.1 Mandatory Upgrade - Added checkpoint at 850000 - Enforce beacon age; beacons over 6 months are discarded network wide. Beacons may be re-sent without restarting if they are expired. - To sync: From the command line on windows: grcrestarter downloadblocks. NOTE ** We still need 51% to upgrade to stay in sync. After block 855000, clients enforce the mandatory upgrade.
- Loading branch information
Showing
8 changed files
with
40 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1359,6 +1359,7 @@ bool AdvertiseBeacon(bool bFromService, std::string &sOutPrivKey, std::string &s | |
std::string sBeaconPublicKey = GetBeaconPublicKey(GlobalCPUMiningCPID.cpid); | ||
if (!sBeaconPublicKey.empty()) | ||
{ | ||
// Ensure they can re-send the beacon if > 6 months old : GetBeaconPublicKey returns an empty string when > 6 months: OK. | ||
sError = "ALREADY_IN_CHAIN"; | ||
return bFromService ? true : false; | ||
} | ||
|
@@ -3817,10 +3818,19 @@ std::string GetLocalBeaconPublicKey(std::string cpid) | |
return sBeaconPubKey; | ||
} | ||
|
||
std::string RetrieveCachedValueWithMaxAge(std::string sKey, int64_t iMaxSeconds) | ||
{ | ||
int64_t iAge = GetAdjustedTime() - mvApplicationCacheTimestamp[sKey]; | ||
std::string sValue = mvApplicationCache[sKey]; | ||
This comment has been minimized.
Sorry, something went wrong.
tomasbrod
Member
|
||
// if (fDebug3) printf("\r\n BeaconAge %f, MaxAge %f, CPID %s\r\n",(double)iAge,(double)iMaxSeconds,sValue.c_str()); | ||
return (iAge > iMaxSeconds) ? "" : sValue; | ||
} | ||
|
||
std::string GetBeaconPublicKey(std::string cpid) | ||
{ | ||
std::string sBeacon = mvApplicationCache["beacon;" + cpid]; | ||
//3-26-2017 - Ensure beacon public key is within 6 months of network age | ||
int64_t iMaxSeconds = 60 * 24 * 30 * 6 * 60; | ||
This comment has been minimized.
Sorry, something went wrong.
denravonska
Member
|
||
std::string sBeacon = RetrieveCachedValueWithMaxAge("beacon;" + cpid, iMaxSeconds); | ||
if (sBeacon.empty()) return ""; | ||
// Beacon data structure: CPID,hashRand,Address,beacon public key: base64 encoded | ||
std::string sContract = DecodeBase64(sBeacon); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why on testnet error is reported with DoS() and on prod with error()?