From 058f5854c28af96a66f962bb2dddb603047501c8 Mon Sep 17 00:00:00 2001 From: biblepay Date: Wed, 24 Jul 2019 13:22:36 -0500 Subject: [PATCH] 1.4.4.5-Mandatory Upgrade - Ensure gobjects are propagated through entire network - Add configurable key : -changequantity=n (this allows you to specify how many change outputs you wish to receive from GSC transmissions, default is 10) --- configure.ac | 2 +- src/clientversion.cpp | 2 +- src/clientversion.h | 2 +- src/governance.cpp | 14 ++++++++------ src/smartcontract-client.cpp | 7 +++++-- src/version.h | 2 +- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index f1bd2be35287e..cb8bae00a27e2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 1) define(_CLIENT_VERSION_MINOR, 4) define(_CLIENT_VERSION_REVISION, 4) -define(_CLIENT_VERSION_BUILD, 4) +define(_CLIENT_VERSION_BUILD, 5) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 1ce37d4bdfc89..4bfb6e3032aeb 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -18,7 +18,7 @@ const std::string CLIENT_NAME("BiblePay Core"); const int BIBLEPAY_VERSION_MAJOR = 1; const int BIBLEPAY_VERSION_MINOR = 4; const int BIBLEPAY_VERSION_REVISION = 4; -const int BIBLEPAY_VERSION_BUILD = 4; +const int BIBLEPAY_VERSION_BUILD = 5; const int BIBLE_VERSION = 1000000 * BIBLEPAY_VERSION_MAJOR diff --git a/src/clientversion.h b/src/clientversion.h index b3e59e4f036a6..7b4d886ccece2 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -17,7 +17,7 @@ #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 4 #define CLIENT_VERSION_REVISION 4 -#define CLIENT_VERSION_BUILD 4 +#define CLIENT_VERSION_BUILD 5 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/governance.cpp b/src/governance.cpp index 09a38e1084689..cf8df3d61eb29 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -460,8 +460,8 @@ void CGovernanceManager::UpdateCachesAndClean() // keep hashes of deleted proposals forever nTimeExpired = std::numeric_limits::max(); } else { - int64_t nSuperblockCycleSeconds = Params().GetConsensus().nSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; - nTimeExpired = pObj->GetCreationTime() + 2 * nSuperblockCycleSeconds + GOVERNANCE_DELETION_DELAY; + int64_t nSuperblockCycleSeconds = Params().GetConsensus().nDCCSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; + nTimeExpired = pObj->GetCreationTime() + 2 * nSuperblockCycleSeconds * 30 + GOVERNANCE_DELETION_DELAY; } mapErasedGovernanceObjects.insert(std::make_pair(nHash, nTimeExpired)); @@ -822,11 +822,13 @@ bool CGovernanceManager::MasternodeRateCheck(const CGovernanceObject& govobj, bo const COutPoint& masternodeOutpoint = govobj.GetMasternodeOutpoint(); int64_t nTimestamp = govobj.GetCreationTime(); int64_t nNow = GetAdjustedTime(); - int64_t nSuperblockCycleSeconds = Params().GetConsensus().nSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; + + // BIBLEPAY - R ANDREWS - Adjust Receive Rate buffer for gobjects + int64_t nSuperblockCycleSeconds = Params().GetConsensus().nDCCSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; std::string strHash = govobj.GetHash().ToString(); - if (nTimestamp < nNow - 2 * nSuperblockCycleSeconds) { + if (nTimestamp < nNow - 2 * nSuperblockCycleSeconds * 30) { LogPrintf("CGovernanceManager::MasternodeRateCheck -- object %s rejected due to too old timestamp, masternode = %s, timestamp = %d, current time = %d\n", strHash, masternodeOutpoint.ToStringShort(), nTimestamp, nNow); return false; @@ -1009,7 +1011,7 @@ void CGovernanceManager::CheckPostponedObjects(CConnman& connman) // Perform additional relays for triggers int64_t nNow = GetAdjustedTime(); - int64_t nSuperblockCycleSeconds = Params().GetConsensus().nSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; + int64_t nSuperblockCycleSeconds = Params().GetConsensus().nDCCSuperblockCycle * Params().GetConsensus().nPowTargetSpacing; for (hash_s_it it = setAdditionalRelayObjects.begin(); it != setAdditionalRelayObjects.end();) { object_m_it itObject = mapObjects.find(*it); @@ -1018,7 +1020,7 @@ void CGovernanceManager::CheckPostponedObjects(CConnman& connman) int64_t nTimestamp = govobj.GetCreationTime(); - bool fValid = (nTimestamp <= nNow + MAX_TIME_FUTURE_DEVIATION) && (nTimestamp >= nNow - 2 * nSuperblockCycleSeconds); + bool fValid = (nTimestamp <= nNow + MAX_TIME_FUTURE_DEVIATION) && (nTimestamp >= nNow - 2 * nSuperblockCycleSeconds * 30); bool fReady = (nTimestamp <= nNow + MAX_TIME_FUTURE_DEVIATION - RELIABLE_PROPAGATION_TIME); if (fValid) { diff --git a/src/smartcontract-client.cpp b/src/smartcontract-client.cpp index efc3acc22f618..56cb0a888a2c1 100644 --- a/src/smartcontract-client.cpp +++ b/src/smartcontract-client.cpp @@ -236,8 +236,11 @@ CWalletTx CreateGSCClientTransmission(std::string sCampaign, std::string sDiary, // R ANDREWS - Split change into 10 Bankroll Denominations - this makes smaller amounts available for ABNs double nMinRequiredABNWeight = GetSporkDouble("requiredabnweight", 0); bool fSubtractFeeFromAmount = true; - - double iQty = (nPayment1/COIN) > nMinRequiredABNWeight ? 10 : 1; + double dChangeQty = cdbl(GetArg("-changequantity", "10"), 2); + if (dChangeQty < 01) dChangeQty = 1; + if (dChangeQty > 50) dChangeQty = 50; + + double iQty = (nPayment1/COIN) > nMinRequiredABNWeight ? dChangeQty : 1; double nEach = (double)1 / iQty; for (int i = 0; i < iQty; i++) { diff --git a/src/version.h b/src/version.h index e49bca8e64ac8..b43051611a3bf 100644 --- a/src/version.h +++ b/src/version.h @@ -10,7 +10,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 70735; +static const int PROTOCOL_VERSION = 70736; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209;