Merge remote-tracking branch 'upstream/v0.11.2.x' into v0.11.2.x

This commit is contained in:
crowning- 2015-03-22 05:10:43 +01:00
commit ffd9b295c1
7 changed files with 101 additions and 92 deletions

View File

@ -180,7 +180,7 @@ bool CActiveMasternode::Dseep(std::string& errorMessage) {
if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode)) if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode))
{ {
LogPrintf("Register::ManageStatus() - Error upon calling SetKey: %s\n", errorMessage.c_str()); LogPrintf("CActiveMasternode::Dseep() - Error upon calling SetKey: %s\n", errorMessage.c_str());
return false; return false;
} }
@ -247,7 +247,7 @@ bool CActiveMasternode::Register(std::string strService, std::string strKeyMaste
if(!GetMasterNodeVin(vin, pubKeyCollateralAddress, keyCollateralAddress, txHash, strOutputIndex)) { if(!GetMasterNodeVin(vin, pubKeyCollateralAddress, keyCollateralAddress, txHash, strOutputIndex)) {
errorMessage = "could not allocate vin"; errorMessage = "could not allocate vin";
LogPrintf("Register::Register() - Error: %s\n", errorMessage.c_str()); LogPrintf("CActiveMasternode::Register() - Error: %s\n", errorMessage.c_str());
return false; return false;
} }
@ -256,7 +256,7 @@ bool CActiveMasternode::Register(std::string strService, std::string strKeyMaste
{ {
if(!address.SetString(strDonationAddress)) if(!address.SetString(strDonationAddress))
{ {
LogPrintf("Register::Register - Invalid Donation Address\n"); LogPrintf("CActiveMasternode::Register - Invalid Donation Address\n");
return false; return false;
} }
donationAddress.SetDestination(address.Get()); donationAddress.SetDestination(address.Get());
@ -264,13 +264,13 @@ bool CActiveMasternode::Register(std::string strService, std::string strKeyMaste
try { try {
donationPercentage = boost::lexical_cast<int>( strDonationPercentage ); donationPercentage = boost::lexical_cast<int>( strDonationPercentage );
} catch( boost::bad_lexical_cast const& ) { } catch( boost::bad_lexical_cast const& ) {
LogPrintf("Register::Register - Invalid Donation Percentage (Couldn't cast)\n"); LogPrintf("CActiveMasternode::Register - Invalid Donation Percentage (Couldn't cast)\n");
return false; return false;
} }
if(donationPercentage < 0 || donationPercentage > 100) if(donationPercentage < 0 || donationPercentage > 100)
{ {
LogPrintf("Register::Register - Donation Percentage Out Of Range\n"); LogPrintf("CActiveMasternode::Register - Donation Percentage Out Of Range\n");
return false; return false;
} }
} }

View File

@ -102,7 +102,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
} }
} else if (strCommand == "dsq") { //Darksend Queue } else if (strCommand == "dsq") { //Darksend Queue
LOCK(cs_darksend); TRY_LOCK(cs_darksend, lockRecv);
if(!lockRecv) return;
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
return; return;
@ -645,6 +646,7 @@ void CDarksendPool::SetNull(bool clearEverything){
} }
//automatically downgrade for 11.2, blinding will be supported in 11.3/12.0 //automatically downgrade for 11.2, blinding will be supported in 11.3/12.0
nTrickleInputsOutputs = INT_MAX;
Downgrade(); Downgrade();
// -- seed random number generator (used for ordering output lists) // -- seed random number generator (used for ordering output lists)
@ -2508,7 +2510,6 @@ void CDarksendPool::RelayInAnon(std::vector<CTxIn>& vin, std::vector<CTxOut>& vo
void CDarksendPool::RelayIn(const std::vector<CTxDSIn>& vin, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector<CTxDSOut>& vout) void CDarksendPool::RelayIn(const std::vector<CTxDSIn>& vin, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector<CTxDSOut>& vout)
{ {
LOCK(cs_vNodes);
std::vector<CTxIn> vin2; std::vector<CTxIn> vin2;
std::vector<CTxOut> vout2; std::vector<CTxOut> vout2;
@ -2519,6 +2520,7 @@ void CDarksendPool::RelayIn(const std::vector<CTxDSIn>& vin, const int64_t& nAmo
BOOST_FOREACH(CTxDSOut out, vout) BOOST_FOREACH(CTxDSOut out, vout)
vout2.push_back(out); vout2.push_back(out);
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
if(!pSubmittedToMasternode) return; if(!pSubmittedToMasternode) return;

View File

@ -7,6 +7,7 @@
#include "core.h" #include "core.h"
#include "main.h" #include "main.h"
#include "sync.h"
#include "activemasternode.h" #include "activemasternode.h"
#include "masternodeman.h" #include "masternodeman.h"
#include "darksend-relay.h" #include "darksend-relay.h"

View File

@ -2742,8 +2742,11 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd
pos.nPos = infoLastBlockFile.nSize; pos.nPos = infoLastBlockFile.nSize;
} }
infoLastBlockFile.nSize += nAddSize;
infoLastBlockFile.AddBlock(nHeight, nTime); infoLastBlockFile.AddBlock(nHeight, nTime);
if (fKnown)
infoLastBlockFile.nSize = std::max(pos.nPos + nAddSize, infoLastBlockFile.nSize);
else
infoLastBlockFile.nSize += nAddSize;
if (!fKnown) { if (!fKnown) {
unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE; unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;

View File

@ -7,6 +7,7 @@
#include "darksend.h" #include "darksend.h"
#include "core.h" #include "core.h"
#include "util.h" #include "util.h"
#include "sync.h"
#include "addrman.h" #include "addrman.h"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
@ -222,7 +223,9 @@ uint256 CMasternode::CalculateScore(int mod, int64_t nBlockHeight)
void CMasternode::Check() void CMasternode::Check()
{ {
LOCK(cs_main); //TODO: Random segfault with this line removed
TRY_LOCK(cs_main, lockRecv);
if(!lockRecv) return;
if(nScanningErrorCount >= MASTERNODE_SCANNING_ERROR_THESHOLD) if(nScanningErrorCount >= MASTERNODE_SCANNING_ERROR_THESHOLD)
{ {

View File

@ -160,7 +160,7 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
OverviewPage::~OverviewPage() OverviewPage::~OverviewPage()
{ {
disconnect(timer, SIGNAL(timeout()), this, SLOT(darkSendStatus())); if(!fLiteMode) disconnect(timer, SIGNAL(timeout()), this, SLOT(darkSendStatus()));
delete ui; delete ui;
} }