Various Darksend Improvements

- Denomination label shows n/a after reset now
- Fixed collateral checking bug introduced by updating to Bitcoin v9 codebase
This commit is contained in:
Evan Duffield 2014-12-29 08:50:40 -07:00
parent 139f14a1a4
commit 762080140b
3 changed files with 11 additions and 10 deletions

View File

@ -922,7 +922,6 @@ bool CDarkSendPool::IsCollateralValid(const CTransaction& txCollateral){
int64_t nValueOut = 0; int64_t nValueOut = 0;
bool missingTx = false; bool missingTx = false;
CTransaction tx;
BOOST_FOREACH(const CTxOut o, txCollateral.vout){ BOOST_FOREACH(const CTxOut o, txCollateral.vout){
nValueOut += o.nValue; nValueOut += o.nValue;
@ -957,9 +956,8 @@ bool CDarkSendPool::IsCollateralValid(const CTransaction& txCollateral){
if(fDebug) LogPrintf("CDarkSendPool::IsCollateralValid %s\n", txCollateral.ToString().c_str()); if(fDebug) LogPrintf("CDarkSendPool::IsCollateralValid %s\n", txCollateral.ToString().c_str());
CWalletTx wtxCollateral = CWalletTx(pwalletMain, txCollateral);
CValidationState state; CValidationState state;
if(AcceptableInputs(mempool, state, tx)){ if(!AcceptableInputs(mempool, state, txCollateral)){
if(fDebug) LogPrintf ("CDarkSendPool::IsCollateralValid - didn't pass IsAcceptable\n"); if(fDebug) LogPrintf ("CDarkSendPool::IsCollateralValid - didn't pass IsAcceptable\n");
return false; return false;
} }
@ -1166,7 +1164,7 @@ bool CDarkSendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep
UpdateState(newState); UpdateState(newState);
entriesCount = newEntriesCount; entriesCount = newEntriesCount;
strAutoDenomResult = "Masternode: " + error; if(error.size() > 0) strAutoDenomResult = "Masternode: " + error;
if(newAccepted != -1) { if(newAccepted != -1) {
lastEntryAccepted = newAccepted; lastEntryAccepted = newAccepted;

View File

@ -284,7 +284,7 @@ public:
if(!(Params().NetworkID() == CChainParams::TESTNET)) { if(!(Params().NetworkID() == CChainParams::TESTNET)) {
strAddress = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF"; strAddress = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF";
} else { } else {
strAddress = "mxE2Rp3oYpSEFdsN5TdHWhZvEHm3PJQQVm"; strAddress = "y1EZuxhhNMAUofTBEeLqGE1bJrpC2TWRNp";
} }
lastSplitUpBlock = 0; lastSplitUpBlock = 0;
@ -296,7 +296,6 @@ public:
minBlockSpacing = 1; minBlockSpacing = 1;
nDsqCount = 0; nDsqCount = 0;
vecDisabledDenominations.clear(); vecDisabledDenominations.clear();
strAutoDenomResult = "";
SetCollateralAddress(strAddress); SetCollateralAddress(strAddress);
SetNull(); SetNull();

View File

@ -413,10 +413,14 @@ void OverviewPage::darkSendStatus()
ui->darksendStatus->setText(s); ui->darksendStatus->setText(s);
if(darkSendPool.sessionDenom == 0){
ui->label_10->setText("n/a");
} else {
std::string out; std::string out;
darkSendPool.GetDenominationsToString(darkSendPool.sessionDenom, out); darkSendPool.GetDenominationsToString(darkSendPool.sessionDenom, out);
QString s2(out.c_str()); QString s2(out.c_str());
ui->label_10->setText(s2); ui->label_10->setText(s2);
}
showingDarkSendMessage++; showingDarkSendMessage++;
darksendActionCheck++; darksendActionCheck++;