Skip to content

Commit da6e011

Browse files
committed
3.5.8.9-leisure
Gridcoin Research 3.5.8.9/MSI=42.3 Leisure Upgrade - Make client readvertise beacon using existing keypair after 5 months - Implement voting functionality for Linux and OSX (@skcin). - Windows are now resizable - Replace Windows voting dialog with the new dialog - Update Gridcoin icon on Windows - Update Hungarian translations (@matthew11), Update Portuguese translations (Miguel Veiga). - Update icon set by @Peppernrino, Update icon on OSX, #193 (@coagmano) - Reduced memory usage by around 100MB+. Optimize released resources. - Improve UI when used with dark themes on Linux, #222 (@skcin) - Fix occasional crashes when starting on Linux, #139 - Fix freeze when clicking on the "Amount" field under Send Coins when using KDE, #210. - Fix OSX build issues, #174 (@coagmano) - Change splash screen - Add manpages (Caraka), Add Travis, Various spelling corrections
1 parent a8442f7 commit da6e011

File tree

8 files changed

+122
-30
lines changed

8 files changed

+122
-30
lines changed

contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -232,37 +232,37 @@
232232
"Entry"
233233
{
234234
"MsmKey" = "8:_UNDEFINED"
235-
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
235+
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
236236
"MsmSig" = "8:_UNDEFINED"
237237
}
238238
"Entry"
239239
{
240240
"MsmKey" = "8:_UNDEFINED"
241-
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
241+
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
242242
"MsmSig" = "8:_UNDEFINED"
243243
}
244244
"Entry"
245245
{
246246
"MsmKey" = "8:_UNDEFINED"
247-
"OwnerKey" = "8:_5644D8F767F33372E534FBD5A2384D12"
247+
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
248248
"MsmSig" = "8:_UNDEFINED"
249249
}
250250
"Entry"
251251
{
252252
"MsmKey" = "8:_UNDEFINED"
253-
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
253+
"OwnerKey" = "8:_5644D8F767F33372E534FBD5A2384D12"
254254
"MsmSig" = "8:_UNDEFINED"
255255
}
256256
"Entry"
257257
{
258258
"MsmKey" = "8:_UNDEFINED"
259-
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
259+
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
260260
"MsmSig" = "8:_UNDEFINED"
261261
}
262262
"Entry"
263263
{
264264
"MsmKey" = "8:_UNDEFINED"
265-
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
265+
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
266266
"MsmSig" = "8:_UNDEFINED"
267267
}
268268
}
@@ -1084,19 +1084,19 @@
10841084
{
10851085
"Name" = "8:Microsoft Visual Studio"
10861086
"ProductName" = "8:Gridcoin Research"
1087-
"ProductCode" = "8:{187182ED-AEF9-46D8-91FD-4839828A6C9D}"
1088-
"PackageCode" = "8:{417B50AD-DB90-4AFC-BA6A-9022A071FD61}"
1087+
"ProductCode" = "8:{F3A8CB75-803B-4E7F-A47A-5D46B62E32F2}"
1088+
"PackageCode" = "8:{9F16C455-84CE-460E-AE14-9B3F11E85CCF}"
10891089
"UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}"
10901090
"AspNetVersion" = "8:4.0.30319.0"
10911091
"RestartWWWService" = "11:FALSE"
10921092
"RemovePreviousVersions" = "11:TRUE"
10931093
"DetectNewerInstalledVersion" = "11:FALSE"
10941094
"InstallAllUsers" = "11:TRUE"
1095-
"ProductVersion" = "8:42.2"
1095+
"ProductVersion" = "8:42.3"
10961096
"Manufacturer" = "8:GridcoinResearch"
10971097
"ARPHELPTELEPHONE" = "8:"
10981098
"ARPHELPLINK" = "8:"
1099-
"Title" = "8:Gridcoin Research 42.2"
1099+
"Title" = "8:Gridcoin Research 42.3"
11001100
"Subject" = "8:"
11011101
"ARPCONTACT" = "8:The Gridcoin Developers"
11021102
"Keywords" = "8:Gridcoin Research"

contrib/easywinbuilder/opt/1xqt.bat

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@call set_vars.bat
2+
@echo Building QT
3+
4+
5+
set INCLUDE=a:\Gridcoin-Research\libs\libpng;a:\Gridcoin-Research\libs\openssl-1.0.1g\include
6+
set LIB=a:\Gridcoin-Research\libs\libpng\.libs;a:\Gridcoin-Research\libs\openssl-1.0.1g
7+
8+
set PATH=%PATH%;a:\Qt\5.8.0\bin;c:\windows\system32;a:\MinGW32\bin;a:\perl\bin
9+
cd a:\Qt\5.8.0
10+
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -openssl -no-dbus -no-qml-debug
11+
12+
mingw32-make
13+
@pause
14+
15+
16+
17+
cd C:\Qt\qttools-opensource-src-5.8.0
18+
qmake qttools.pro
19+
mingw32-make
20+
21+
22+
@pause
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@call set_vars.bat
2+
@echo Building boost...
3+
@cd %ROOTPATH%\%EWBLIBS%\boost_1_57_0
4+
5+
@echo bootstrap...
6+
call bootstrap.bat mingw
7+
@echo.
8+
@echo.
9+
@echo building...
10+
b2.exe --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread^
11+
toolset=gcc variant=release link=static threading=multi runtime-link=static^
12+
--layout=versioned -sNO_BZIP2=1 -sNO_ZLIB=1^
13+
target-os=windows^
14+
threadapi=win32^
15+
cxxflags="%ADDITIONALCCFLAGS%"^
16+
cflags="%ADDITIONALCCFLAGS%"^
17+
stage
18+
@cd ..\..\%EWBPATH%
19+
@if not "%RUNALL%"=="1" pause

object_script.gridcoinresearch.Debug

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ INPUT(
1414
./build/upgradedialog.o
1515
./build/editaddressdialog.o
1616
./build/bitcoinaddressvalidator.o
17+
./build/votingdialog.o
1718
./build/alert.o
1819
./build/version.o
1920
./build/sync.o
@@ -105,6 +106,7 @@ INPUT(
105106
./build/moc_qvaluecombobox.o
106107
./build/moc_askpassphrasedialog.o
107108
./build/moc_notificator.o
109+
./build/moc_votingdialog.o
108110
./build/moc_rpcconsole.o
109111
./build/qrc_bitcoin.o
110112
./build/qrc_jquery.o

object_script.gridcoinresearch.Release

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ INPUT(
1414
./build/upgradedialog.o
1515
./build/editaddressdialog.o
1616
./build/bitcoinaddressvalidator.o
17+
./build/votingdialog.o
1718
./build/alert.o
1819
./build/version.o
1920
./build/sync.o
@@ -105,6 +106,7 @@ INPUT(
105106
./build/moc_qvaluecombobox.o
106107
./build/moc_askpassphrasedialog.o
107108
./build/moc_notificator.o
109+
./build/moc_votingdialog.o
108110
./build/moc_rpcconsole.o
109111
./build/qrc_bitcoin.o
110112
./build/qrc_jquery.o

src/clientversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 3
1010
#define CLIENT_VERSION_MINOR 5
1111
#define CLIENT_VERSION_REVISION 8
12-
#define CLIENT_VERSION_BUILD 8
12+
#define CLIENT_VERSION_BUILD 9
1313

1414
// Converts the parameter X to a string after macro replacement on X has been performed.
1515
// Don't merge these into one macro!

src/main.cpp

+26-9
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030
#include <boost/asio.hpp>
3131

3232
int GetDayOfYear();
33+
void GetBeaconElements(std::string sBeacon,std::string& out_cpid, std::string& out_address, std::string& out_publickey);
3334
extern std::string NodeAddress(CNode* pfrom);
3435
extern std::string ConvertBinToHex(std::string a);
3536
extern std::string ConvertHexToBin(std::string a);
3637
extern bool WalletOutOfSync();
3738
extern bool WriteKey(std::string sKey, std::string sValue);
38-
std::string GetBeaconPublicKey(std::string cpid);
39+
std::string GetBeaconPublicKey(std::string cpid,bool bAdvertisingBeacon);
3940
std::string GetBeaconPrivateKey(std::string cpid);
4041
bool AdvertiseBeacon(bool bFromService, std::string &sOutPrivKey, std::string &sOutPubKey, std::string &sError, std::string &sMessage);
4142
std::string SignBlockWithCPID(std::string sCPID, std::string sBlockHash);
@@ -8461,7 +8462,7 @@ std::string SerializeBoincBlock(MiningCPID mcpid)
84618462

84628463
if (!mcpid.cpid.empty() && mcpid.cpid != "INVESTOR" && mcpid.lastblockhash != "0")
84638464
{
8464-
mcpid.BoincPublicKey = GetBeaconPublicKey(mcpid.cpid);
8465+
mcpid.BoincPublicKey = GetBeaconPublicKey(mcpid.cpid,false);
84658466
if (!mcpid.BoincPublicKey.empty())
84668467
{
84678468
mcpid.BoincSignature = SignBlockWithCPID(mcpid.cpid,mcpid.lastblockhash);
@@ -9745,14 +9746,30 @@ bool MemorizeMessage(std::string msg, int64_t nTime, double dAmount, std::string
97459746

97469747
if (sMessageType=="beacon" && sMessageAction=="A")
97479748
{
9748-
// If the Beacon Public Key is Not Empty - do not overwrite with a new beacon value
9749-
std::string sBPK = GetBeaconPublicKey(sMessageKey);
9750-
// Note that if the beacon is > 6 months old, this function now returns an empty string (allowing the beacon to be overwritten) : OK
9751-
if (!sBPK.empty())
9749+
// If the Beacon Public Key is Not Empty - do not overwrite with a new beacon value unless the public key is the same
9750+
std::string sBPK = GetBeaconPublicKey(sMessageKey,false);
9751+
if (!sBPK.empty())
97529752
{
9753-
// Do not overwrite this beacon
9754-
sMessageValue="";
9755-
if (fDebug10) printf("\r\n**Beacon Public Key Not Empty %s : %s\r\n",sMessageKey.c_str(),sBPK.c_str());
9753+
std::string out_cpid = "";
9754+
std::string out_address = "";
9755+
std::string out_publickey = "";
9756+
GetBeaconElements(sMessageValue, out_cpid, out_address, out_publickey);
9757+
if (fDebug3 && LessVerbose(50))
9758+
{
9759+
printf("\r\n**Beacon Debug Message : beaconpubkey %s, message key %s, cpid %s, addr %s, base64 pub key %s \r\n ",sBPK.c_str(),
9760+
sMessageKey.c_str(),out_cpid.c_str(),out_address.c_str(), out_publickey.c_str());
9761+
}
9762+
if (sBPK == out_publickey)
9763+
{
9764+
// allow key to be reloaded in since this is a refreshed beacon
9765+
if (fDebug10) printf("\r\n**Beacon Being Overwritten %s \r\n %s : %s\r\n",sBPK.c_str(),sMessageKey.c_str(),sBPK.c_str());
9766+
}
9767+
else
9768+
{
9769+
// In this case, the current Beacon is not empty and the keys are different - Do not overwrite this beacon
9770+
sMessageValue="";
9771+
if (fDebug10) printf("\r\n**Beacon Public Key Not Empty %s : %s\r\n",sMessageKey.c_str(),sBPK.c_str());
9772+
}
97569773
}
97579774

97589775
}

src/rpcblockchain.cpp

+40-10
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ double ReturnTotalRacByCPID(std::string cpid);
2424
std::string UnpackBinarySuperblock(std::string sBlock);
2525
std::string PackBinarySuperblock(std::string sBlock);
2626
int DetermineCPIDType(std::string cpid);
27+
extern void GetBeaconElements(std::string sBeacon,std::string& out_cpid, std::string& out_address, std::string& out_publickey);
2728
bool AskForOutstandingBlocks(uint256 hashStart);
2829
bool WriteKey(std::string sKey, std::string sValue);
2930
bool CleanChain();
3031
extern std::string SendReward(std::string sAddress, int64_t nAmount);
3132
std::string GetLocalBeaconPublicKey(std::string cpid);
3233
extern double GetMagnitudeByCpidFromLastSuperblock(std::string sCPID);
33-
extern std::string GetBeaconPublicKey(std::string cpid);
34+
extern std::string GetBeaconPublicKey(std::string cpid,bool bAdvertising);
3435
extern std::string GetBeaconPrivateKey(std::string cpid);
3536
extern std::string SuccessFail(bool f);
3637
extern Array GetUpgradedBeaconReport();
@@ -1353,10 +1354,11 @@ bool AdvertiseBeacon(bool bFromService, std::string &sOutPrivKey, std::string &s
13531354
return bFromService ? true : false;
13541355
}
13551356
//If beacon is already in the chain, exit early
1356-
std::string sBeaconPublicKey = GetBeaconPublicKey(GlobalCPUMiningCPID.cpid);
1357+
std::string sBeaconPublicKey = GetBeaconPublicKey(GlobalCPUMiningCPID.cpid,true);
13571358
if (!sBeaconPublicKey.empty())
13581359
{
1359-
// Ensure they can re-send the beacon if > 6 months old : GetBeaconPublicKey returns an empty string when > 6 months: OK.
1360+
// Ensure they can re-send the beacon if > 5 months old : GetBeaconPublicKey returns an empty string when > 5 months: OK.
1361+
// Note that we allow the client to re-advertise the beacon in 5 months, so that they have a seamless and uninterrupted keypair in use (prevents a hacker from hijacking a keypair that is in use)
13601362
sError = "ALREADY_IN_CHAIN";
13611363
return bFromService ? true : false;
13621364
}
@@ -1939,7 +1941,7 @@ Value execute(const Array& params, bool fHelp)
19391941

19401942
entry.push_back(Pair("CPID", sCPID));
19411943
std::string sBeacon = MyBeaconExists(sCPID);
1942-
std::string sPubKey = GetBeaconPublicKey(sCPID);
1944+
std::string sPubKey = GetBeaconPublicKey(sCPID,false);
19431945
std::string sPrivKey = GetBeaconPrivateKey(sCPID);
19441946
int64_t iBeaconTimestamp = BeaconTimeStamp(sCPID, false);
19451947
std::string timestamp = TimestampToHRDate(iBeaconTimestamp);
@@ -3831,10 +3833,11 @@ std::string RetrieveBeaconValueWithMaxAge(const std::string& cpid, int64_t iMaxS
38313833
: value;
38323834
}
38333835

3834-
std::string GetBeaconPublicKey(std::string cpid)
3836+
std::string GetBeaconPublicKey(std::string cpid, bool bAdvertisingBeacon)
38353837
{
3836-
//3-26-2017 - Ensure beacon public key is within 6 months of network age
3837-
int64_t iMaxSeconds = 60 * 24 * 30 * 6 * 60;
3838+
//3-26-2017 - Ensure beacon public key is within 6 months of network age (If advertising, let it be returned as missing after 5 months, to ensure the public key is renewed seamlessly).
3839+
int iMonths = bAdvertisingBeacon ? 5 : 6;
3840+
int64_t iMaxSeconds = 60 * 24 * 30 * iMonths * 60;
38383841
std::string sBeacon = RetrieveBeaconValueWithMaxAge(cpid, iMaxSeconds);
38393842
if (sBeacon.empty()) return "";
38403843
// Beacon data structure: CPID,hashRand,Address,beacon public key: base64 encoded
@@ -3845,9 +3848,36 @@ std::string GetBeaconPublicKey(std::string cpid)
38453848
return sBeaconPublicKey;
38463849
}
38473850

3851+
3852+
3853+
void GetBeaconElements(std::string sBeacon,std::string& out_cpid, std::string& out_address, std::string& out_publickey)
3854+
{
3855+
if (sBeacon.empty()) return;
3856+
std::string sContract = DecodeBase64(sBeacon);
3857+
std::vector<std::string> vContract = split(sContract.c_str(),";");
3858+
if (vContract.size() < 4) return;
3859+
out_cpid = vContract[0];
3860+
out_address = vContract[2];
3861+
out_publickey = vContract[3];
3862+
}
3863+
3864+
3865+
3866+
3867+
std::string GetBeaconPublicKeyFromContract(std::string sEncContract)
3868+
{
3869+
if (sEncContract.empty()) return "";
3870+
// Beacon data structure: CPID,hashRand,Address,beacon public key: base64 encoded
3871+
std::string sContract = DecodeBase64(sEncContract);
3872+
std::vector<std::string> vContract = split(sContract.c_str(),";");
3873+
if (vContract.size() < 4) return "";
3874+
std::string sBeaconPublicKey = vContract[3];
3875+
return sBeaconPublicKey;
3876+
}
3877+
38483878
bool VerifyCPIDSignature(std::string sCPID, std::string sBlockHash, std::string sSignature)
38493879
{
3850-
std::string sBeaconPublicKey = GetBeaconPublicKey(sCPID);
3880+
std::string sBeaconPublicKey = GetBeaconPublicKey(sCPID,false);
38513881
std::string sConcatMessage = sCPID + sBlockHash;
38523882
bool bValid = CheckMessageSignature("R","cpid", sConcatMessage, sSignature, sBeaconPublicKey);
38533883
return bValid;
@@ -4755,7 +4785,7 @@ Value listitem(const Array& params, bool fHelp)
47554785
Object entry;
47564786
// Test a sample CPID keypair
47574787
entry.push_back(Pair("CPID",msPrimaryCPID));
4758-
std::string sBeaconPublicKey = GetBeaconPublicKey(msPrimaryCPID);
4788+
std::string sBeaconPublicKey = GetBeaconPublicKey(msPrimaryCPID,false);
47594789
entry.push_back(Pair("Beacon Public Key",sBeaconPublicKey));
47604790
std::string sSignature = SignBlockWithCPID(msPrimaryCPID,"1000");
47614791
entry.push_back(Pair("Signature",sSignature));
@@ -4768,7 +4798,7 @@ Value listitem(const Array& params, bool fHelp)
47684798
entry.push_back(Pair("Right block, Wrong Signature Valid",fResult));
47694799
// Missing Beacon, with wrong CPID
47704800
std::string sCPID = "1234567890";
4771-
sBeaconPublicKey = GetBeaconPublicKey(sCPID);
4801+
sBeaconPublicKey = GetBeaconPublicKey(sCPID,false);
47724802
sSignature = SignBlockWithCPID(sCPID,"1001");
47734803
entry.push_back(Pair("Signature",sSignature));
47744804
fResult = VerifyCPIDSignature(sCPID, "1001", sSignature);

0 commit comments

Comments
 (0)