Skip to content
Permalink
Browse files

1.1.8.8-Leisure Upgrade

- Prevent exec bankroll from spending bankroll denominations
- Prevent PODCUpdate from spending bankroll denominations
  • Loading branch information...
biblepay committed Feb 14, 2019
1 parent 52b3fe8 commit 6c781f259129af4d3e9600157f5cae4ee6772671
Showing with 24 additions and 11 deletions.
  1. +1 −1 configure.ac
  2. +1 −1 src/clientversion.cpp
  3. +4 −2 src/rpcpog.cpp
  4. +18 −7 src/wallet/wallet.cpp
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 8)
define(_CLIENT_VERSION_BUILD, 7)
define(_CLIENT_VERSION_BUILD, 8)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([biblepay Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/biblepaypay/biblepay/issues],[biblepaycore])
@@ -19,7 +19,7 @@ const std::string CLIENT_NAME("Biblepay Core");
const int BIBLEPAY_VERSION_MAJOR = 1;
const int BIBLEPAY_VERSION_MINOR = 1;
const int BIBLEPAY_VERSION_REVISION = 8;
const int BIBLEPAY_VERSION_BUILD = 7;
const int BIBLEPAY_VERSION_BUILD = 8;


const int BIBLE_VERSION = 1000000 * BIBLEPAY_VERSION_MAJOR
@@ -95,6 +95,8 @@ std::string CreateBankrollDenominations(double nQuantity, CAmount denominationAm
{
// First mark the denominations with the 1milliBBP TitheMarker (this saves them from being spent in PODC Updates):
denominationAmount += ((.001) * COIN);
CAmount nBankrollMask = .001 * COIN;

CAmount nTotal = denominationAmount * nQuantity;

CAmount curBalance = pwalletMain->GetUnlockedBalance();
@@ -122,7 +124,7 @@ std::string CreateBankrollDenominations(double nQuantity, CAmount denominationAm

bool fUseInstantSend = false;
double minCoinAge = 0;
if (!pwalletMain->CreateTransaction(vecSend, wtx, reservekey, nFeeRequired, nChangePosRet, sError, NULL, true, ONLY_NOT1000IFMN, fUseInstantSend, 0, minCoinAge, 0, denominationAmount))
if (!pwalletMain->CreateTransaction(vecSend, wtx, reservekey, nFeeRequired, nChangePosRet, sError, NULL, true, ONLY_NOT1000IFMN, fUseInstantSend, 0, minCoinAge, 0, nBankrollMask))
{
if (!sError.empty())
{
@@ -1196,7 +1198,7 @@ std::string AddBlockchainMessages(std::string sAddress, std::string sType, std::
// Never spend sanctuary funds - R ANDREWS - BIBLEPAY
// PODC_Update: Addl params required to enforce coin_age: bool fUseInstantSend=false, int iMinConfirms = 0, double dMinCoinAge = 0, CAmount caMinCoinAmount = 0
// Ensure we don't spend POG bankroll denominations
CAmount nBankrollMask = (.001) * COIN;
CAmount nBankrollMask = .001 * COIN;

if (!pwalletMain->CreateTransaction(vecSend, wtx, reservekey, nFeeRequired, nChangePosRet,
sError, NULL, true, ONLY_NOT1000IFMN, fUseInstantSend, 0, minCoinAge, 0, nBankrollMask))
@@ -1892,7 +1892,7 @@ CAmount CWallet::GetUnlockedBalance() const
bool fLocked = (nAmount == (SANCTUARY_COLLATERAL * COIN));
if (!fLocked)
{
if (nCoinDepth > 5)
if (nCoinDepth >= 5)
{
nTotal += nAmount;
}
@@ -2275,6 +2275,21 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
if (nDepth == 0 && !pcoin->InMempool())
continue;

bool fBankrollTx = false;
if (nBankrollMask > 0)
{
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
{
if (CompareMask(pcoin->vout[i].nValue, nBankrollMask))
{
if (false) LogPrintf("\n AvailableCoins::Skipping output %f for %f ",i, (double)pcoin->vout[i].nValue/COIN);
fBankrollTx = true;
}
}
}

if (fBankrollTx) continue;

for (unsigned int i = 0; i < pcoin->vout.size(); i++)
{
bool found = false;
@@ -2284,11 +2299,6 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
if (cct.Color=="401" && nCoinType != ONLY_RETIREMENT_COINS) continue;
if (nMinAmount > 0 && pcoin->vout[i].nValue < nMinAmount) continue;
if (nMinAge > 0 && nAge < nMinAge) continue;
if (nBankrollMask > 0)
{
// If the mask matches, dont spend these POG bankroll denominations
if (CompareMask(pcoin->vout[i].nValue, nBankrollMask)) continue;
}
if (nCoinType == ONLY_RETIREMENT_COINS && cct.Color=="401")
{
found = true;
@@ -2556,7 +2566,8 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
if(!out.fSpendable)
continue;

if(nCoinType == ONLY_DENOMINATED) {
if(nCoinType == ONLY_DENOMINATED)
{
CTxIn txin = CTxIn(out.tx->GetHash(),out.i);
int nRounds = GetInputPrivateSendRounds(txin);
// make sure it's actually anonymized

0 comments on commit 6c781f2

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.