mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
changed splitting strategy
This commit is contained in:
parent
15683a8d9e
commit
38e0802472
@ -9,7 +9,7 @@
|
||||
#define CLIENT_VERSION_MAJOR 0
|
||||
#define CLIENT_VERSION_MINOR 10
|
||||
#define CLIENT_VERSION_REVISION 13
|
||||
#define CLIENT_VERSION_BUILD 9
|
||||
#define CLIENT_VERSION_BUILD 10
|
||||
|
||||
// Set to true for release, false for prerelease or test build
|
||||
#define CLIENT_VERSION_IS_RELEASE true
|
||||
|
@ -1292,8 +1292,7 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral)
|
||||
std::string strFail = "";
|
||||
vector< pair<CScript, int64> > vecSend;
|
||||
|
||||
int64 a = nTotalBalance;
|
||||
if(a > 4096*COIN) a = 4096*COIN;
|
||||
int64 a = 1*COIN;
|
||||
|
||||
// ****** Add fees ************ /
|
||||
vecSend.push_back(make_pair(scriptChange, DARKSEND_COLLATERAL*5));
|
||||
@ -1302,27 +1301,21 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral)
|
||||
|
||||
nTotalOut += (DARKSEND_COLLATERAL*5)+(DARKSEND_FEE*5);
|
||||
|
||||
// if over 1000, start by adding 1 darksend compatible input
|
||||
int64 compatibleDsInput = 998*COIN;
|
||||
if(nTotalBalance > compatibleDsInput){
|
||||
vecSend.push_back(make_pair(scriptChange, compatibleDsInput));
|
||||
nTotalOut += (compatibleDsInput);
|
||||
}
|
||||
|
||||
// ****** Add outputs in bases of two from 4096 darkcoin in reverse *** /
|
||||
// ****** Add outputs in bases of two from 1 darkcoin *** /
|
||||
if(!justCollateral){
|
||||
bool continuing = true;
|
||||
|
||||
while(continuing){
|
||||
while(nTotalOut + a < nTotalBalance-DARKSEND_FEE){
|
||||
if(nTotalOut + a < nTotalBalance-DARKSEND_FEE){
|
||||
//LogPrintf(" nTotalOut %"PRI64d", added %"PRI64d"\n", nTotalOut, a);
|
||||
|
||||
vecSend.push_back(make_pair(scriptChange, a));
|
||||
nTotalOut += a;
|
||||
} else {
|
||||
continuing = false;
|
||||
}
|
||||
|
||||
a = a / 2;
|
||||
if(a < 1*COIN) continuing = false;
|
||||
a = a * 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user