Skip to content

Commit

Permalink
Add checkpoint and merge upstream PR #849
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoDev-Project committed Apr 5, 2019
1 parent 8142065 commit bbe117a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ static void convertSeed6(std::vector<CAddress>& vSeedsOut, const SeedSpec6* data
// + Contains no strange transactions
static Checkpoints::MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, uint256("0000080ab32d3fdbb4c9e2c5c84419f8dabea84676ad2ef8ca86f73b86cf86c0"));
( 0, uint256("0000080ab32d3fdbb4c9e2c5c84419f8dabea84676ad2ef8ca86f73b86cf86c0"))
( 50, uint256("00000068810f3b72470dac384c395aee650cc35f6f087e0fdd70543042f7744f"));
static const Checkpoints::CCheckpointData data = {
&mapCheckpoints,
1554402932, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
1554441589, // * UNIX timestamp of last checkpoint block
51, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
2000 // * estimated number of transactions per day after checkpoint
};
Expand Down
9 changes: 5 additions & 4 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4219,8 +4219,8 @@ void CWallet::AutoCombineDust()
vRewardCoins.push_back(out);
nTotalRewardsValue += out.Value();

// Combine to the threshold and not way above
if (nTotalRewardsValue > nAutoCombineThreshold * COIN)
// Combine until our total is enough above the threshold to remain above after adjustments
if ((nTotalRewardsValue - nTotalRewardsValue / 10) > nAutoCombineThreshold * COIN)
break;

// Around 180 bytes per input. We use 190 to be certain
Expand Down Expand Up @@ -4266,15 +4266,16 @@ void CWallet::AutoCombineDust()
}

//we don't combine below the threshold unless the fees are 0 to avoid paying fees over fees over fees
if (!maxSize && nTotalRewardsValue < nAutoCombineThreshold * COIN && nFeeRet > 0)
if (!maxSize && vecSend[0].second < nAutoCombineThreshold * COIN && nFeeRet > 0)
continue;

if (!CommitTransaction(wtx, keyChange)) {
LogPrintf("AutoCombineDust transaction commit failed\n");
continue;
}

LogPrintf("AutoCombineDust sent transaction\n");
LogPrintf("AutoCombineDust sent transaction. Fee=%d, Total Value=%d Sending=%d\n",
nFeeRet, nTotalRewardsValue, vecSend[0].second);

delete coinControl;
}
Expand Down

0 comments on commit bbe117a

Please sign in to comment.