Skip to content

Commit

Permalink
1.4.4.5-Mandatory Upgrade
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
biblepay committed Jul 24, 2019
1 parent 9f3cf54 commit 058f585
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions src/governance.cpp
Expand Up @@ -460,8 +460,8 @@ void CGovernanceManager::UpdateCachesAndClean()
// keep hashes of deleted proposals forever
nTimeExpired = std::numeric_limits<int64_t>::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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
7 changes: 5 additions & 2 deletions src/smartcontract-client.cpp
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Expand Up @@ -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;
Expand Down

0 comments on commit 058f585

Please sign in to comment.