Skip to content

Commit

Permalink
3.5.9.0-Leisure
Browse files Browse the repository at this point in the history
Gridcoin Research 3.5.9.0/MSI=42.4
Leisure Upgrade

- Upgraded security on voting system - voting proof of balance and proof
of magnitude
- Magnitude enhancement by Tomas
- Added execute unspentreport (shows proof of unspent coins in wallet)
- Added FoggyXs beacon fixes
- Added Translations
  • Loading branch information
gridcoin committed Jun 5, 2017
1 parent bb1283b commit fc3ba19
Show file tree
Hide file tree
Showing 9 changed files with 488 additions and 52 deletions.
13 changes: 9 additions & 4 deletions gridcoinresearch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd thread c++11 exceptions concurrent
QT += core gui network

win32 {
lessThan(QT_VERSION, 5.0.0) {
win32
{
DEFINES += _WIN32_WINNT=0x0501 WINVER=0x0501
lessThan(QT_VERSION, 5.0.0)
{
CONFIG += qaxcontainer
} else {
}
else
{
QT += axcontainer
}
}
Expand Down Expand Up @@ -73,7 +78,6 @@ contains(RELEASE, 1) {
QMAKE_LFLAGS *= -Wl,--large-address-aware
}


# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
Expand Down Expand Up @@ -441,6 +445,7 @@ isEmpty(BOOST_INCLUDE_PATH) {
windows:DEFINES += WIN32
windows:RC_FILE = src/qt/res/bitcoin-qt.rc


windows:!contains(MINGW_THREAD_BUGFIX, 0) {
# At least qmake's win32-g++-cross profile is missing the -lmingwthrd
# thread-safety flag. GCC has -mthreads to enable this, but it doesn't
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 5
#define CLIENT_VERSION_REVISION 8
#define CLIENT_VERSION_BUILD 9
#define CLIENT_VERSION_REVISION 9
#define CLIENT_VERSION_BUILD 0

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
33 changes: 27 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extern std::string getCpuHash();
std::string getMacAddress();
std::string TimestampToHRDate(double dtm);
bool CPIDAcidTest2(std::string bpk, std::string externalcpid);

extern std::string VectorToString(std::vector<unsigned char> v);
bool HasActiveBeacon(const std::string& cpid);
extern bool BlockNeedsChecked(int64_t BlockTime);
extern void FixInvalidResearchTotals(std::vector<CBlockIndex*> vDisconnect, std::vector<CBlockIndex*> vConnect);
Expand Down Expand Up @@ -512,6 +512,19 @@ bool PushGridcoinDiagnostics()
return false;
}


vector<unsigned char> StringToVector(std::string sData)
{
vector<unsigned char> v(sData.begin(), sData.end());
return v;
}

std::string VectorToString(vector<unsigned char> v)
{
std::string s(v.begin(), v.end());
return s;
}

bool FullSyncWithDPORNodes()
{
#if defined(WIN32) && defined(QT_GUI)
Expand Down Expand Up @@ -3998,7 +4011,14 @@ bool CBlock::CheckBlock(std::string sCaller, int height1, int64_t Mint, bool fCh

if (bb.cpid != "INVESTOR" && IsProofOfStake() && height1 > nGrandfather && IsResearchAgeEnabled(height1) && BlockNeedsChecked(nTime) && !fLoadingIndex)
{
int64_t nCalculatedResearch = GetProofOfStakeReward(nCoinAge, nFees, bb.cpid, true, 1, nTime,
// 6-4-2017 - Verify researchers stored block magnitude
double dNeuralNetworkMagnitude = CalculatedMagnitude2(bb.cpid, nTime, false);
if (bb.Magnitude > 0 && bb.Magnitude > (dNeuralNetworkMagnitude*1.25) && (fTestNet || height1 > 947000))
{
return error("CheckBlock[ResearchAge] : Researchers block magnitude > neural network magnitude: Block Magnitude %f, Neural Network Magnitude %f, CPID %s ",
(double)bb.Magnitude,(double)dNeuralNetworkMagnitude,bb.cpid.c_str());
}
int64_t nCalculatedResearch = GetProofOfStakeReward(nCoinAge, nFees, bb.cpid, true, 1, nTime,
pindexBest, sCaller + "_checkblock_researcher", OUT_POR, OUT_INTEREST, dAccrualAge, dMagnitudeUnit, dAvgMagnitude);
if (bb.ResearchSubsidy > ((OUT_POR*1.25)+1))
{
Expand Down Expand Up @@ -5588,8 +5608,8 @@ bool GetEarliestStakeTime(std::string grcaddress, std::string cpid)
return true;
}

if (IsLockTimeWithinMinutes(nLastGRCtallied,100))
return true;
if (IsLockTimeWithinMinutes(nLastGRCtallied,100) && (mvApplicationCacheTimestamp["nGRCTime"] > 0 ||
mvApplicationCacheTimestamp["nCPIDTime"] > 0)) return true;

nLastGRCtallied = GetAdjustedTime();
int64_t nGRCTime = 0;
Expand Down Expand Up @@ -5621,9 +5641,9 @@ bool GetEarliestStakeTime(std::string grcaddress, std::string cpid)
}
else
{
myCPID = pblockindex->GetCPID();
myCPID = pblockindex->GetCPID();
}
if (cpid == myCPID && nCPIDTime==0)
if (cpid == myCPID && nCPIDTime==0 && myCPID != "INVESTOR")
{
nCPIDTime = pblockindex->nTime;
nGRCTime = pblockindex->nTime;
Expand All @@ -5633,6 +5653,7 @@ bool GetEarliestStakeTime(std::string grcaddress, std::string cpid)
}
int64_t EarliestStakedWalletTx = GetEarliestWalletTransaction();
if (EarliestStakedWalletTx > 0 && EarliestStakedWalletTx < nGRCTime) nGRCTime = EarliestStakedWalletTx;
if (cpid=="INVESTOR" && EarliestStakedWalletTx > 0) nGRCTime = EarliestStakedWalletTx;
if (fTestNet) nGRCTime -= (86400*30);
if (nGRCTime <= 0) nGRCTime = GetAdjustedTime();
if (nCPIDTime <= 0) nCPIDTime = GetAdjustedTime();
Expand Down
2 changes: 2 additions & 0 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ bool OutOfSyncByAgeWithChanceOfMining();
MiningCPID DeserializeBoincBlock(std::string block);
std::string SerializeBoincBlock(MiningCPID mcpid);
bool LessVerbose(int iMax1000);
std::string PubKeyToAddress(const CScript& scriptPubKey);

bool IsCPIDValidv2(MiningCPID& mc,int height);

int static FormatHashBlocks(void* pbuffer, unsigned int len)
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie

int64_t nBalance = 0;
std::vector<COutput> vCoins;
wallet->AvailableCoins(vCoins, true, coinControl);
wallet->AvailableCoins(vCoins, true, coinControl,false);

BOOST_FOREACH(const COutput& out, vCoins)
nBalance += out.tx->vout[out.i].nValue;
Expand Down Expand Up @@ -503,7 +503,7 @@ void WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vect
void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const
{
std::vector<COutput> vCoins;
wallet->AvailableCoins(vCoins);
wallet->AvailableCoins(vCoins,true,NULL,false);

LOCK2(cs_main, wallet->cs_wallet); // ListLockedCoins, mapWallet
std::vector<COutPoint> vLockedCoins;
Expand Down
Loading

1 comment on commit fc3ba19

@TheCharlatan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gridcoinresearch.pro is not parsed anymore with either qmake , or qmake-qt5. This is because the braces are not on the same line as the conditions. I already opened a pull request to fix this quickly.

Please sign in to comment.