diff --git a/src/main.cpp b/src/main.cpp index d16cf209d8..ccd5885e40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4130,6 +4130,7 @@ void static ProcessGetData(CNode* pfrom) } if (!pushed && inv.type == MSG_TX) { + CTransaction tx; if (mempool.lookup(inv.hash, tx)) { CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); @@ -4661,7 +4662,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else if (strCommand == "tx"|| strCommand == "dstx") { - vector vWorkQueue; vector vEraseQueue; CTransaction tx; diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index af9578eac9..44c1882da5 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -86,7 +86,6 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s void CBudgetManager::CheckOrphanVotes() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); @@ -186,7 +185,6 @@ void CBudgetManager::SubmitFinalBudget() return; } - LogPrintf("LOCK - %\n", __func__); LOCK(cs); mapSeenFinalizedBudgets.insert(make_pair(finalizedBudgetBroadcast.GetHash(), finalizedBudgetBroadcast)); finalizedBudgetBroadcast.Relay(); @@ -372,7 +370,6 @@ bool CBudgetManager::AddFinalizedBudget(CFinalizedBudget& finalizedBudget) bool CBudgetManager::AddProposal(CBudgetProposal& budgetProposal) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); std::string strError = ""; if(!budgetProposal.IsValid(strError)) { @@ -415,7 +412,6 @@ void CBudgetManager::CheckAndRemove() void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); CBlockIndex* pindexPrev = chainActive.Tip(); @@ -493,7 +489,6 @@ CBudgetProposal *CBudgetManager::FindProposal(const std::string &strProposalName CBudgetProposal *CBudgetManager::FindProposal(uint256 nHash) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); if(mapProposals.count(nHash)) @@ -546,7 +541,6 @@ bool CBudgetManager::HasNextFinalizedBudget() bool CBudgetManager::IsTransactionValid(const CTransaction& txNew, int nBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); int nHighestCount = 0; @@ -596,7 +590,6 @@ bool CBudgetManager::IsTransactionValid(const CTransaction& txNew, int nBlockHei std::vector CBudgetManager::GetAllProposals() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); std::vector vBudgetProposalRet; @@ -629,7 +622,6 @@ struct sortProposalsByVotes { //Need to review this function std::vector CBudgetManager::GetBudget() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); // ------- Sort budgets by Yes Count @@ -693,7 +685,6 @@ struct sortFinalizedBudgetsByVotes { std::vector CBudgetManager::GetFinalizedBudgets() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); std::vector vFinalizedBudgetsRet; @@ -723,7 +714,6 @@ std::vector CBudgetManager::GetFinalizedBudgets() std::string CBudgetManager::GetRequiredPaymentsString(int nBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); std::string ret = "unknown-budget"; @@ -775,7 +765,6 @@ CAmount CBudgetManager::GetTotalBudget(int nHeight) void CBudgetManager::NewBlock() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); if (masternodeSync.RequestedMasternodeAssets <= MASTERNODE_SYNC_BUDGET) return; @@ -818,7 +807,6 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // lite mode is not supported if(IsInitialBlockDownload()) return; - LogPrintf("LOCK - %\n", __func__); LOCK(cs_budget); if (strCommand == "mnvs") { //Masternode vote sync @@ -971,7 +959,6 @@ bool CBudgetManager::PropExists(uint256 nHash) void CBudgetManager::Sync(CNode* pfrom, uint256 nProp) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); /* @@ -1036,7 +1023,6 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp) bool CBudgetManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::string& strError) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); if(!mapProposals.count(vote.nProposalHash)){ @@ -1064,7 +1050,6 @@ bool CBudgetManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::string bool CBudgetManager::UpdateFinalizedBudget(CFinalizedBudgetVote& vote, CNode* pfrom, std::string& strError) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); if(!mapFinalizedBudgets.count(vote.nBudgetHash)){ @@ -1184,7 +1169,6 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral) bool CBudgetProposal::AddOrUpdateVote(CBudgetVote& vote, std::string& strError) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); uint256 hash = vote.vin.prevout.GetHash(); @@ -1467,7 +1451,6 @@ CFinalizedBudget::CFinalizedBudget(const CFinalizedBudget& other) bool CFinalizedBudget::AddOrUpdateVote(CFinalizedBudgetVote& vote, std::string& strError) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); uint256 hash = vote.vin.prevout.GetHash(); @@ -1507,7 +1490,6 @@ bool CFinalizedBudget::AddOrUpdateVote(CFinalizedBudgetVote& vote, std::string& //evaluate if we should vote for this. Masternode only void CFinalizedBudget::AutoCheck() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); if(!fMasterNode || fAutoChecked) return; @@ -1578,7 +1560,6 @@ CAmount CFinalizedBudget::GetTotalPayout() std::string CFinalizedBudget::GetProposals() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); std::string ret = ""; diff --git a/src/masternode-budget.h b/src/masternode-budget.h index ffe0be3b65..afb50cfca9 100644 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -131,7 +131,6 @@ public: void CheckOrphanVotes(); void Clear(){ - LogPrintf("LOCK - %\n", __func__); LOCK(cs); LogPrintf("Budget object cleared\n"); @@ -228,7 +227,6 @@ public: bool IsTransactionValid(const CTransaction& txNew, int nBlockHeight); bool GetBudgetPaymentByBlock(int64_t nBlockHeight, CTxBudgetPayment& payment) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); int i = nBlockHeight - GetBlockStart(); @@ -239,7 +237,6 @@ public: } bool GetPayeeAndAmount(int64_t nBlockHeight, CScript& payee, CAmount& nAmount) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs); int i = nBlockHeight - GetBlockStart(); diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 653846ad1b..3452a4a1b6 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -438,7 +438,6 @@ bool CMasternodePayments::GetBlockPayee(int nBlockHeight, CScript& payee) // -- Only look ahead up to 8 blocks to allow for propagation of the latest 2 winners bool CMasternodePayments::IsScheduled(CMasternode& mn, int nNotBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodeBlocks); CBlockIndex* pindexPrev = chainActive.Tip(); @@ -493,7 +492,6 @@ bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerI bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_vecPayments); int nMaxSignatures = 0; @@ -541,7 +539,6 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew) std::string CMasternodeBlockPayees::GetRequiredPaymentsString() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_vecPayments); std::string ret = "Unknown"; @@ -564,7 +561,6 @@ std::string CMasternodeBlockPayees::GetRequiredPaymentsString() std::string CMasternodePayments::GetRequiredPaymentsString(int nBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodeBlocks); if(mapMasternodeBlocks.count(nBlockHeight)){ @@ -576,7 +572,6 @@ std::string CMasternodePayments::GetRequiredPaymentsString(int nBlockHeight) bool CMasternodePayments::IsTransactionValid(const CTransaction& txNew, int nBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodeBlocks); if(mapMasternodeBlocks.count(nBlockHeight)){ @@ -588,7 +583,6 @@ bool CMasternodePayments::IsTransactionValid(const CTransaction& txNew, int nBlo void CMasternodePayments::CleanPaymentList() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodePayeeVotes); if(chainActive.Tip() == NULL) return; @@ -762,7 +756,6 @@ bool CMasternodePaymentWinner::SignatureValid() void CMasternodePayments::Sync(CNode* node, int nCountNeeded) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodePayeeVotes); if(chainActive.Tip() == NULL) return; @@ -798,7 +791,6 @@ std::string CMasternodePayments::ToString() const int CMasternodePayments::GetOldestBlock() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodeBlocks); int nOldestBlock = std::numeric_limits::max(); @@ -818,7 +810,6 @@ int CMasternodePayments::GetOldestBlock() int CMasternodePayments::GetNewestBlock() { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodeBlocks); int nNewestBlock = 0; diff --git a/src/masternode-payments.h b/src/masternode-payments.h index 46a52210c1..21d937420d 100644 --- a/src/masternode-payments.h +++ b/src/masternode-payments.h @@ -100,7 +100,6 @@ public: } void AddPayee(CScript payeeIn, int nIncrement){ - LogPrintf("LOCK - %\n", __func__); LOCK(cs_vecPayments); BOOST_FOREACH(CMasternodePayee& payee, vecPayments){ @@ -116,7 +115,6 @@ public: bool GetPayee(CScript& payee) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_vecPayments); int nVotes = -1; @@ -132,7 +130,6 @@ public: bool HasPayeeWithVotes(CScript payee, int nVotesReq) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_vecPayments); BOOST_FOREACH(CMasternodePayee& p, vecPayments){ @@ -238,7 +235,6 @@ public: } void Clear() { - LogPrintf("LOCK - %\n", __func__); LOCK2(cs_mapMasternodeBlocks, cs_mapMasternodePayeeVotes); mapMasternodeBlocks.clear(); mapMasternodePayeeVotes.clear(); @@ -256,7 +252,6 @@ public: bool IsScheduled(CMasternode& mn, int nNotBlockHeight); bool CanVote(COutPoint outMasternode, int nBlockHeight) { - LogPrintf("LOCK - %\n", __func__); LOCK(cs_mapMasternodePayeeVotes); if(mapMasternodesLastVote.count(outMasternode.hash + outMasternode.n)) {