Skip to content

Commit

Permalink
Cleanup/maintenance (#830)
Browse files Browse the repository at this point in the history
* remove instance references inside own class

* better logging

* remove unused

* fix tabs/spaces

* bitcoin->dash

* fix README.md
  • Loading branch information
UdjinM6 authored and schinzelh committed May 30, 2016
1 parent f5e3042 commit 4d55bc9
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 1,394 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Dash Core staging tree 0.12
Dash Core staging tree 0.12.1
===============================

`master:` [![Build Status](https://travis-ci.org/dashpay/dash.svg?branch=master)](https://travis-ci.org/dashpay/dash) `v0.12.0.x:` [![Build Status](https://travis-ci.org/dashpay/dash.svg?branch=v0.12.0.x)](https://travis-ci.org/dashpay/dash/branches) `v0.12.1.x:` [![Build Status](https://travis-ci.org/dashpay/dash.svg?branch=v0.12.1.x)](https://travis-ci.org/dashpay/dash/branches)

https://www.dash.org


Expand Down Expand Up @@ -72,4 +74,4 @@ Translations are periodically pulled from Transifex and merged into the git repo
**Important**: We do not accept translation changes as GitHub pull requests because the next
pull from Transifex would automatically overwrite them again.

Translators should also follow the [forum](https://dashtalk.org/forums/dash-worldwide-collaboration.88/).
Translators should also follow the [forum](https://www.dash.org/forum/topic/dash-worldwide-collaboration.88/).
17 changes: 16 additions & 1 deletion src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void CDarksendPool::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataS
return;
}

darkSendPool.CompletedTransaction(error, errorID);
CompletedTransaction(error, errorID);
}

}
Expand Down Expand Up @@ -1445,6 +1445,14 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)

if(nBalanceNeedsDenominated > nValueIn) nBalanceNeedsDenominated = nValueIn;

LogPrint("privatesend", "%s -- SelectCoinsDark -- (%f - (%f + %f - %f = %f) ) = %f\n", __func__,
(float)nBalanceNeedsAnonymized/COIN,
(float)pwalletMain->GetDenominatedBalance(true)/COIN,
(float)pwalletMain->GetDenominatedBalance()/COIN,
(float)pwalletMain->GetAnonymizedBalance()/COIN,
(float)nOnlyDenominatedBalance/COIN,
(float)nBalanceNeedsDenominated/COIN);

if(nBalanceNeedsDenominated < nLowestDenom) return false; // most likely we just waiting for denoms to confirm
if(!fDryRun) return CreateDenominated(nBalanceNeedsDenominated);

Expand All @@ -1461,6 +1469,13 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)

nOnlyDenominatedBalance = pwalletMain->GetDenominatedBalance(true) + pwalletMain->GetDenominatedBalance() - pwalletMain->GetAnonymizedBalance();
nBalanceNeedsDenominated = nBalanceNeedsAnonymized - nOnlyDenominatedBalance;
LogPrint("privatesend", "%s -- 'nBalanceNeedsDenominated > nOnlyDenominatedBalance' (%f - (%f + %f - %f = %f) ) = %f\n", __func__,
(float)nBalanceNeedsAnonymized/COIN,
(float)pwalletMain->GetDenominatedBalance(true)/COIN,
(float)pwalletMain->GetDenominatedBalance()/COIN,
(float)pwalletMain->GetAnonymizedBalance()/COIN,
(float)nOnlyDenominatedBalance/COIN,
(float)nBalanceNeedsDenominated/COIN);

//check if we have should create more denominated inputs
if(nBalanceNeedsDenominated > nOnlyDenominatedBalance) return CreateDenominated(nBalanceNeedsDenominated);
Expand Down
4 changes: 0 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ void Interrupt(boost::thread_group& threadGroup)
/** Preparing steps before shutting down or restarting the wallet */
void PrepareShutdown()
{
LogPrintf("1 %s\n", governance.ToString());

fRequestShutdown = true; // Needed when we shutdown the wallet
fRestartRequested = true; // Needed when we restart the wallet
LogPrintf("%s: In progress...\n", __func__);
Expand All @@ -201,8 +199,6 @@ void PrepareShutdown()
if (!lockShutdown)
return;

LogPrintf("2 %s\n", governance.ToString());

/// Note: Shutdown() must be able to handle cases in which AppInit2() failed part of the way,
/// for example if the data directory was found to be locked.
/// Be sure that anything that writes files or flushes caches only does this if the respective
Expand Down
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,17 +1450,17 @@ int64_t GetTotalCoinEstimate(int nHeight)
/* these values are taken from the block explorer */
if(nHeight > 5076) nTotalCoins += 2021642;
if(nHeight > 17000) nTotalCoins += 3267692-2021642;
if(nHeight > 34000) nTotalCoins += 3688775-3267692;
if(nHeight > 68000) nTotalCoins += 4277615-3688775;
if(nHeight > 34000) nTotalCoins += 3688775-3267692;
if(nHeight > 68000) nTotalCoins += 4277615-3688775;

if(nHeight > 68000*2) {
nTotalCoins += 4649913.99999995-4277615;
nTotalCoins += 4649913.99999995-4277615;
} else {
return nTotalCoins;
}

//5.383754730451325 per block average after this
nTotalCoins += ((nHeight-68000*2)*((5382104.64334133-4649913.99999995)/(68000*2)));
nTotalCoins += ((nHeight-68000*2)*((5382104.64334133-4649913.99999995)/(68000*2)));

// TODO: this should include the 7.1% decline too
return nTotalCoins;
Expand Down Expand Up @@ -4565,7 +4565,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
}
}

if (!pushed && inv.type == MSG_DSTX) {
if (!pushed && inv.type == MSG_DSTX) {
if(mapDarksendBroadcastTxes.count(inv.hash)){
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000);
Expand Down
Loading

0 comments on commit 4d55bc9

Please sign in to comment.