From e9d6e2e0e85f6026a4025956c0a9f11701c98ed0 Mon Sep 17 00:00:00 2001 From: Tranz5 Date: Sat, 9 Sep 2017 23:56:40 -0400 Subject: [PATCH] Version 2.0 Changes for more stable block chain. 2min block time 1 day old min age Old Clients will be disconnted on Friday Sep 15th --- HoboNickels-qt.pro | 2 +- src/checkpoints.cpp | 4 +- src/clientversion.h | 8 +-- src/kernel.cpp | 12 ++-- src/main.cpp | 123 +++++++++++++++++++++++++++-------- src/main.h | 14 ++-- src/qt/clientmodel.cpp | 2 +- src/qt/coincontroldialog.cpp | 2 +- src/version.cpp | 6 +- src/version.h | 2 +- src/wallet.cpp | 2 +- 11 files changed, 124 insertions(+), 53 deletions(-) diff --git a/HoboNickels-qt.pro b/HoboNickels-qt.pro index 673dc73..44839e3 100644 --- a/HoboNickels-qt.pro +++ b/HoboNickels-qt.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = HoboNickels-qt -VERSION = 1.5.5.4 +VERSION = 2.0.0.0 QT += core gui network INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN __NO_SYSTEM_INCLUDES diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 06c7fbc..3b07cb3 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -320,7 +320,7 @@ namespace Checkpoints { // Test signing a sync-checkpoint with genesis block CSyncCheckpoint checkpoint; - checkpoint.hashCheckpoint = !fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet; + checkpoint.hashCheckpoint = (!fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet); CDataStream sMsg(SER_NETWORK, PROTOCOL_VERSION); sMsg << (CUnsignedSyncCheckpoint)checkpoint; checkpoint.vchMsg = std::vector(sMsg.begin(), sMsg.end()); @@ -375,7 +375,7 @@ namespace Checkpoints assert(mapBlockIndex.count(hashSyncCheckpoint)); const CBlockIndex* pindexSync = mapBlockIndex[hashSyncCheckpoint]; return (nBestHeight >= pindexSync->nHeight + nCoinbaseMaturity || - pindexSync->GetBlockTime() + nStakeMinAge < GetAdjustedTime()); + pindexSync->GetBlockTime() + SetStakeMinAge() < GetAdjustedTime()); } } diff --git a/src/clientversion.h b/src/clientversion.h index 891293c..582a017 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -6,10 +6,10 @@ // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it -#define CLIENT_VERSION_MAJOR 1 -#define CLIENT_VERSION_MINOR 5 -#define CLIENT_VERSION_REVISION 5 -#define CLIENT_VERSION_BUILD 5 +#define CLIENT_VERSION_MAJOR 2 +#define CLIENT_VERSION_MINOR 0 +#define CLIENT_VERSION_REVISION 0 +#define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/kernel.cpp b/src/kernel.cpp index eaf1c97..165e313 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -41,9 +41,9 @@ int64_t GetWeight(int64_t nIntervalBeginning, int64_t nIntervalEnd) // Maximum TimeWeight is 30 days. if ( nIntervalEnd > VERSION1_5_SWITCH_TIME ) - return min(nIntervalEnd - nIntervalBeginning - nStakeMinAge, (int64_t)nStakeMaxAge); + return min(nIntervalEnd - nIntervalBeginning - SetStakeMinAge(), (int64_t)nStakeMaxAge); else - return min(nIntervalEnd - nIntervalBeginning, (int64_t)nStakeMaxAge) - nStakeMinAge; + return min(nIntervalEnd - nIntervalBeginning, (int64_t)nStakeMaxAge) - SetStakeMinAge(); } // Get the last stake modifier and its generation time from a given block @@ -156,7 +156,7 @@ bool ComputeNextStakeModifier(const CBlockIndex* pindexPrev, uint64_t& nStakeMod // Sort candidate blocks by timestamp vector > vSortedByTimestamp; - vSortedByTimestamp.reserve(64 * nModifierInterval / nStakeTargetSpacing); + vSortedByTimestamp.reserve(64 * nModifierInterval / SetTargetSpacing()); int64_t nSelectionInterval = GetStakeModifierSelectionInterval(); int64_t nSelectionIntervalStart = (pindexPrev->GetBlockTime() / nModifierInterval) * nModifierInterval - nSelectionInterval; const CBlockIndex* pindex = pindexPrev; @@ -234,7 +234,7 @@ static bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifi { if (!pindex->pnext) { // reached best block; may happen if node is behind on block chain - if (fPrintProofOfStake || (pindex->GetBlockTime() + nStakeMinAge - nStakeModifierSelectionInterval > GetAdjustedTime())) + if (fPrintProofOfStake || (pindex->GetBlockTime() + SetStakeMinAge() - nStakeModifierSelectionInterval > GetAdjustedTime())) return error("GetKernelStakeModifier() : reached best block %s at height %d from block %s", pindex->GetBlockHash().ToString(), pindex->nHeight, hashBlockFrom.ToString()); else @@ -287,7 +287,7 @@ bool CheckStakeKernelHash(unsigned int nBits, const CBlock& blockFrom, unsigned return error("CheckStakeKernelHash() : nTime violation"); unsigned int nTimeBlockFrom = blockFrom.GetBlockTime(); - if (nTimeBlockFrom + nStakeMinAge > nTimeTx) // Min age requirement + if (nTimeBlockFrom + SetStakeMinAge() > nTimeTx) // Min age requirement return error("CheckStakeKernelHash() : min age violation"); CBigNum bnTargetPerCoinDay; @@ -365,7 +365,7 @@ bool ScanForStakeKernelHash(MetaMap &mapMeta, KernelSearchSettings &settings, Co static int nMaxStakeSearchInterval = 60; // only count coins meeting min age requirement - if (nStakeMinAge + block.nTime > settings.nTime - nMaxStakeSearchInterval) + if (SetStakeMinAge() + block.nTime > settings.nTime - nMaxStakeSearchInterval) continue; // Transaction offset inside block diff --git a/src/main.cpp b/src/main.cpp index 813fd72..2b5b8c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,13 +38,11 @@ static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); static CBigNum bnProofOfStakeLimit(~uint256(0) >> 24); static CBigNum bnProofOfStakeHardLimit(~uint256(0) >> 30); - static CBigNum bnProofOfWorkLimitTestNet(~uint256(0) >> 16); static CBigNum bnProofOfStakeLimitTestNet(~uint256(0) >> 20); -unsigned int nStakeMinAge = 60 * 60 * 24 * 10; // minimum age for coin age - 10 days unsigned int nStakeMaxAge = 60 * 60 * 24 * 30; // stake age of full weight - 30 days -unsigned int nStakeTargetSpacing = 1 * 30; // 1-minute block spacing + int64_t nChainStartTime = 1371910049; int nCoinbaseMaturity = 5; CBlockIndex* pindexGenesisBlock = NULL; @@ -84,6 +82,23 @@ int64_t nSplitThreshold = GetProofOfWorkReward(); int64_t nCombineThreshold = GetProofOfWorkReward() * 2; extern enum Checkpoints::CPMode CheckpointsMode; +unsigned int SetTargetSpacing() +{ + unsigned int nStakeTargetSpacingSwitch = (fTestNet ? 1 * 60 : 1 * 30); // block spacing, 1 min tesnet, 30 seconds Main (OLD) + if ( nBestHeight + 1 > (fTestNet ? SPACING_TARGET_SWITCH_TESTNET : SPACING_TARGET_SWITCH)) + nStakeTargetSpacingSwitch = 4.20 * 30; // 2 Minute 06 Second block spacing (NEW) + + return nStakeTargetSpacingSwitch; +} + +unsigned int SetStakeMinAge() +{ + unsigned int nStakeMinAgeSwitch = (fTestNet ? 2 * 60 * 60 : 60 * 60 * 24 * 10); // minimum age for coin age - 2hrs TestNet, 10 days Main (OLD) + if (nBestHeight + 1 > (fTestNet ? SPACING_TARGET_SWITCH_TESTNET : SPACING_TARGET_SWITCH)) + nStakeMinAgeSwitch = 60 * 60 * 24 * 1; // minimum age for coin age - 1 day (NEW) + + return nStakeMinAgeSwitch; +} ////////////////////////////////////////////////////////////////////////////// // @@ -160,10 +175,9 @@ void SyncWithWallets(const CTransaction& tx, const CBlock* pblock, bool fUpdate, { LOCK(cs_setpwalletRegistered); BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered) { - if (pwallet->AddToWalletIfInvolvingMe(tx, pblock, fUpdate) ) { - // Preloaded coins cache invalidation - pwallet->SetCoinsDataActual(false); - } + pwallet->AddToWalletIfInvolvingMe(tx, pblock, fUpdate); + // Preloaded coins cache invalidation + pwallet->SetCoinsDataActual(false); } } } @@ -838,7 +852,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CTransaction &tx, // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!tx.ConnectInputs(txdb, mapInputs, mapUnused, CDiskTxPos(1,1,1), pindexBest, false, false, true, SIG_SWITCH_TIME < tx.nTime ? STRICT_FLAGS : SOFT_FLAGS)) + if (!tx.ConnectInputs(txdb, mapInputs, mapUnused, CDiskTxPos(1,1,1), pindexBest, false, false, true, VERSION_2_0_SWITCH_TIME < tx.nTime ? STRICT_FLAGS : SOFT_FLAGS)) { return error("AcceptToMemoryPool : ConnectInputs failed %s", hash.ToString().substr(0,10)); } @@ -1094,7 +1108,9 @@ int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, unsigned int { int64_t nSubsidy = 0; - if ( nTime > VERSION1_5_SWITCH_TIME ) + if ( nTime > (fTestNet ? VERSION_2_0_SWITCH_TIME_TESTNET : VERSION_2_0_SWITCH_TIME) ) + nSubsidy = GetProofOfStakeRewardV3(nCoinAge, nBits, nTime, bCoinYearOnly); + else if ( nTime > VERSION1_5_SWITCH_TIME ) nSubsidy = GetProofOfStakeRewardV2(nCoinAge, nBits, nTime, bCoinYearOnly); else nSubsidy = GetProofOfStakeRewardV1(nCoinAge, nBits, nTime, bCoinYearOnly); @@ -1242,8 +1258,59 @@ int64_t GetProofOfStakeRewardV2(int64_t nCoinAge, unsigned int nBits, unsigned i return nSubsidy; } +int64_t GetProofOfStakeRewardV3(int64_t nCoinAge, unsigned int nBits, unsigned int nTime, bool bCoinYearOnly) +{ + CBigNum bnRewardCoinYearLimit = MAX_MINT_PROOF_OF_STAKE_FIX2; // Base stake mint rate, 100% year interest + int64_t nRewardCoinYearLimit = MAX_MINT_PROOF_OF_STAKE_FIX2; + CBigNum bnTarget; + bnTarget.SetCompact(nBits); + CBigNum bnTargetLimit = bnProofOfStakeLimit; + bnTargetLimit.SetCompact(bnTargetLimit.GetCompact()); + int64_t nSubsidyLimit = 250 * COIN; + + // HoboNickels: reward for coin-year is cut in half every 128x multiply of PoS difficulty + // A reasonably continuous curve is used to avoid shock to market + // (bnRewardCoinYearLimit / nRewardCoinYear) ** 5 == bnProofOfStakeLimit / bnTarget + // + // Human readable form: + // + // nRewardCoinYear = 1 / (posdiff ^ 1/5) + + CBigNum bnLowerBound = 20 * CENT; // Lower interest bound is 20% per year + CBigNum bnUpperBound = bnRewardCoinYearLimit; + CBigNum bnMidPart, bnRewardPart; + + while (bnLowerBound + CENT <= bnUpperBound) + { + CBigNum bnMidValue = (bnLowerBound + bnUpperBound) / 2; + + bnMidPart = bnMidValue * bnMidValue * bnMidValue * bnMidValue * bnMidValue * bnMidValue; + bnRewardPart = bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit * bnRewardCoinYearLimit; + + LogPrint("creation", "GetProofOfStakeReward() : lower=%d upper=%d mid=%d\n", bnLowerBound.getuint64(), bnUpperBound.getuint64(), bnMidValue.getuint64()); + + if (bnMidPart * bnTargetLimit > bnRewardPart * bnTarget) + bnUpperBound = bnMidValue; + else + bnLowerBound = bnMidValue; + } + + int64_t nRewardCoinYear = bnUpperBound.getuint64(); + nRewardCoinYear = min((nRewardCoinYear / CENT) * CENT, nRewardCoinYearLimit); + + if(bCoinYearOnly) + return nRewardCoinYear; + + int64_t nSubsidy = (nCoinAge * 33 * nRewardCoinYear) / (365 * 33 + 8); + + LogPrint("creation","GetProofOfStakeReward(): create=%s nCoinAge=%d nBits=%d, Amount Truncated %s\n", FormatMoney(nSubsidy), nCoinAge, nBits, nSubsidyLimit < nSubsidy ? FormatMoney(nSubsidy - nSubsidyLimit) : FormatMoney(0)); + + nSubsidy = min(nSubsidy, nSubsidyLimit); + + return nSubsidy; +} + static const int64_t nTargetTimespan = 0.16 * 24 * 60 * 60; // 4-hour -static const int64_t nTargetSpacingWorkMax = 12 * nStakeTargetSpacing; // 2-hour // maximum nBits value could possible be required nTime after // @@ -1300,6 +1367,7 @@ unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfS unsigned int GetNextTargetRequiredV1(const CBlockIndex* pindexLast, bool fProofOfStake) { CBigNum bnTargetLimit = !fProofOfStake ? bnProofOfWorkLimit : bnProofOfStakeLimit; + int64_t nTargetSpacingWorkMax = 12 * SetTargetSpacing(); // 2-hour if(fProofOfStake) { @@ -1331,7 +1399,8 @@ unsigned int GetNextTargetRequiredV1(const CBlockIndex* pindexLast, bool fProofO // ppcoin: retarget with exponential moving toward target spacing CBigNum bnNew; bnNew.SetCompact(pindexPrev->nBits); - int64_t nTargetSpacing = fProofOfStake? nStakeTargetSpacing : min(nTargetSpacingWorkMax, (int64_t) nStakeTargetSpacing * (1 + pindexLast->nHeight - pindexPrev->nHeight)); + unsigned int nTargetStakeSpacing = SetTargetSpacing(); + int64_t nTargetSpacing = fProofOfStake ? nTargetStakeSpacing : min(nTargetSpacingWorkMax, (int64_t) nTargetStakeSpacing * (1 + pindexLast->nHeight - pindexPrev->nHeight)); int64_t nInterval = nTargetTimespan / nTargetSpacing; bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing); bnNew /= ((nInterval + 1) * nTargetSpacing); @@ -1345,6 +1414,7 @@ unsigned int GetNextTargetRequiredV1(const CBlockIndex* pindexLast, bool fProofO unsigned int GetNextTargetRequiredV2(const CBlockIndex* pindexLast, bool fProofOfStake) { CBigNum bnTargetLimit = !fProofOfStake ? bnProofOfWorkLimit : bnProofOfStakeLimit; + int64_t nTargetSpacingWorkMax = 12 * SetTargetSpacing(); // 2-hour if (pindexLast == NULL) return bnTargetLimit.GetCompact(); // genesis block @@ -1356,8 +1426,9 @@ unsigned int GetNextTargetRequiredV2(const CBlockIndex* pindexLast, bool fProofO if (pindexPrevPrev->pprev == NULL) return bnTargetLimit.GetCompact(); // second block + unsigned int nTargetStakeSpacing = SetTargetSpacing(); int64_t nActualSpacing = pindexPrev->GetBlockTime() - pindexPrevPrev->GetBlockTime(); - int64_t nTargetSpacing = fProofOfStake? nStakeTargetSpacing : min(nTargetSpacingWorkMax, (int64_t) nStakeTargetSpacing * (1 + pindexLast->nHeight - pindexPrev->nHeight)); + int64_t nTargetSpacing = fProofOfStake ? nTargetStakeSpacing : min(nTargetSpacingWorkMax, (int64_t) nTargetStakeSpacing * (1 + pindexLast->nHeight - pindexPrev->nHeight)); if (nActualSpacing < 0) nActualSpacing = nTargetSpacing; @@ -1673,8 +1744,9 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, MapPrevTx inputs, map nTime) + if (block.GetBlockTime() + SetStakeMinAge() > nTime) continue; // only count coins meeting min age requirement int64_t nValueIn = txPrev.vout[txin.prevout.n].nValue; @@ -2495,15 +2567,6 @@ bool CBlock::AcceptBlock() pnode->PushInventory(CInv(MSG_BLOCK, hash)); } - if (!IsInitialBlockDownload() && (pindexBest->nHeight % 10 ) == 0 ) - { - AssertLockHeld(cs_setpwalletRegistered); - BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered) { - // Preloaded coins cache invalidation - pwallet->SetCoinsDataActual(false); - } - } - // ppcoin: check pending sync-checkpoint Checkpoints::AcceptPendingSyncCheckpoint(); @@ -2891,10 +2954,8 @@ bool LoadBlockIndex(bool fAllowNew) bnProofOfStakeLimit = bnProofOfStakeLimitTestNet; // 0x00000fff PoS base target is fixed in testnet bnProofOfWorkLimit = bnProofOfWorkLimitTestNet; // 0x0000ffff PoW base target is fixed in testnet - nStakeMinAge = 2 * 60 * 60; // test net min age is 2 hours nModifierInterval = 20 * 60; // test modifier interval is 20 minutes nCoinbaseMaturity = 10; // test maturity is 10 blocks - nStakeTargetSpacing = 1 * 60; // test block spacing is 3 minutes } // @@ -3294,6 +3355,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return false; } + if (pfrom->nVersion < 70010 && pindexBest->nHeight + 1 > SPACING_TARGET_SWITCH) + { + // disconnect from peers older than this proto version + LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString(), pfrom->nVersion); + pfrom->fDisconnect = true; + return false; + } + if (pfrom->nVersion == 10300) pfrom->nVersion = 300; if (!vRecv.empty()) @@ -3612,7 +3681,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LogPrint("net", " getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20)); // ppcoin: tell downloading node about the latest block if it's // without risk being rejected due to stake connection check - if (hashStop != hashBestChain && pindex->GetBlockTime() + nStakeMinAge > pindexBest->GetBlockTime()) + if (hashStop != hashBestChain && pindex->GetBlockTime() + SetStakeMinAge() > pindexBest->GetBlockTime()) pfrom->PushInventory(CInv(MSG_BLOCK, hashBestChain)); break; } diff --git a/src/main.h b/src/main.h index 1ccf0d8..2753485 100644 --- a/src/main.h +++ b/src/main.h @@ -66,6 +66,7 @@ static const unsigned int POS_REWARD_SWITCH_TIME = 1378684800; // 9 SEP 2013 00: static const unsigned int POS_REWARD_FIX_TIME = 1383177600; // 31 OCT 2013 00:00:00 static const unsigned int POS_REWARD_FIX_TIME2 = 1383606000; // 04 Nov 2013 23:00:00 static const unsigned int VERSION1_5_SWITCH_TIME = 1421489410; // Sat, 17 Jan 2015 10:10:10 GMT + static const int VERSION1_5_SWITCH_BLOCK = 1600000; // Block 1.6 million, approx same time static const int POW_LIMIT_HEIGHT_TESTNET = 4500; // Limit Flash PoW Mining TestNet. @@ -76,11 +77,11 @@ static const int POW_LIMIT_HEIGHT = 5600000 ; // Limit Flash PoW Mining. static const int POW_STOP_HEIGHT = 6000000; // Limit PoW Mining. static const int64_t POW_TIME_LIMIT = 60 * 10; // Time for PoW to wait to find block -static const unsigned int SIG_SWITCH_TIME = 1519900000; // Thu, 01 Mar 2018 10:26:40 GMT - - - +static const unsigned int VERSION_2_0_SWITCH_TIME = 1505509200; // Fri, 15 Sep 2017 21:00:00 +static const int SPACING_TARGET_SWITCH = 5667000; // Change The Spacing Time +static const unsigned int VERSION_2_0_SWITCH_TIME_TESTNET = 1505002972; // TESTNET +static const int SPACING_TARGET_SWITCH_TESTNET = 6390; // Change The Spacing Time TESTNET inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } /** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */ @@ -115,10 +116,8 @@ extern std::map mapBlockIndex; extern std::set > setStakeSeen; extern uint256 hashGenesisBlock; extern CBlockIndex* pindexGenesisBlock; -extern unsigned int nStakeMinAge; extern unsigned int nStakeMaxAge; extern unsigned int nNodeLifespan; -extern unsigned int nStakeTargetSpacing; extern int nCoinbaseMaturity; extern int nCoinbaseMaturityMultipiler; extern int nBestHeight; @@ -160,6 +159,8 @@ class CTxIndex; class CScriptCheck; struct CNodeStateStats; +unsigned int SetTargetSpacing(); +unsigned int SetStakeMinAge(); void RegisterWallet(CWallet* pwalletIn); void UnregisterWallet(CWallet* pwalletIn); void UnregisterAllWallets(); @@ -194,6 +195,7 @@ int64_t GetProofOfWorkReward(); int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, unsigned int nTime ,bool bCoinYearOnly=false); int64_t GetProofOfStakeRewardV1(int64_t nCoinAge, unsigned int nBits, unsigned int nTime ,bool bCoinYearOnly=false); int64_t GetProofOfStakeRewardV2(int64_t nCoinAge, unsigned int nBits, unsigned int nTime ,bool bCoinYearOnly=false); +int64_t GetProofOfStakeRewardV3(int64_t nCoinAge, unsigned int nBits, unsigned int nTime ,bool bCoinYearOnly=false); unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime); unsigned int ComputeMinStake(unsigned int nBase, int64_t nTime, unsigned int nBlockTime); diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 435ac25..88dcda0 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -94,7 +94,7 @@ double ClientModel::getPosKernalPS() int ClientModel::getStakeTargetSpacing() { - return nStakeTargetSpacing; + return SetTargetSpacing(); } quint64 ClientModel::getTotalBytesRecv() const diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index bb21753..7a3bc8a 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -796,7 +796,7 @@ void CoinControlDialog::updateView() itemOutput->setText(COLUMN_AGE_INT64, strPad(QString::number(nCoinAge), 15, " ")); // Potential Stake - qint64 nStakeAge = nAge - nStakeMinAge < 0 ? 0 : nCoinAge; + qint64 nStakeAge = nAge - SetStakeMinAge() < 0 ? 0 : nCoinAge; qint64 nPotentialStake = (((nYearlyPercent * 1.001) / (365 * COIN)) * nStakeAge * nValue) / COIN; itemOutput->setText(COLUMN_POTENTIALSTAKE, BitcoinUnits::formatAge(nDisplayUnit, nPotentialStake)); itemOutput->setText(COLUMN_POTENTIALSTAKE_INT64, strPad(QString::number(nPotentialStake), 15, " ")); diff --git a/src/version.cpp b/src/version.cpp index db975ee..92e5b49 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -11,7 +11,7 @@ const std::string CLIENT_NAME("HoboNickels"); // Client version number -#define CLIENT_VERSION_SUFFIX "-V1.5" +#define CLIENT_VERSION_SUFFIX "-V2.0" // The following part of the code determines the CLIENT_BUILD variable. @@ -37,9 +37,9 @@ const std::string CLIENT_NAME("HoboNickels"); #define GIT_ARCHIVE 1 #ifdef GIT_ARCHIVE -# define GIT_COMMIT_ID "87b0f55" +# define GIT_COMMIT_ID "" -# define GIT_COMMIT_DATE "Wed Aug 09 22:28:00 2017" +# define GIT_COMMIT_DATE "Sat Sep 09 22:28:00 2017" #endif #define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \ diff --git a/src/version.h b/src/version.h index 46bbee4..f9f7273 100644 --- a/src/version.h +++ b/src/version.h @@ -25,7 +25,7 @@ extern const std::string CLIENT_DATE; static const int DATABASE_VERSION = 70501; // network protocol versioning -static const int PROTOCOL_VERSION = 70009; +static const int PROTOCOL_VERSION = 70010; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; diff --git a/src/wallet.cpp b/src/wallet.cpp index 088bec6..17f5a1c 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1202,7 +1202,7 @@ void CWallet::AvailableCoinsForStaking(vector& vCoins, unsigned int nSp const CWalletTx* pcoin = &(*it).second; // Filtering by tx timestamp instead of block timestamp may give false positives but never false negatives - if (pcoin->nTime + nStakeMinAge > nSpendTime) + if (pcoin->nTime + SetStakeMinAge() > nSpendTime) continue; if (pcoin->GetBlocksToMaturity() > 0)