mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
lock debugging
This commit is contained in:
parent
ff2fa918b6
commit
e230762d5a
@ -4130,7 +4130,6 @@ 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);
|
||||
@ -4662,6 +4661,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
|
||||
else if (strCommand == "tx"|| strCommand == "dstx")
|
||||
{
|
||||
|
||||
vector<uint256> vWorkQueue;
|
||||
vector<uint256> vEraseQueue;
|
||||
CTransaction tx;
|
||||
|
@ -85,6 +85,7 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s
|
||||
|
||||
void CBudgetManager::CheckOrphanVotes()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
std::string strError = "";
|
||||
@ -183,6 +184,7 @@ void CBudgetManager::SubmitFinalBudget()
|
||||
return;
|
||||
}
|
||||
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
mapSeenFinalizedBudgets.insert(make_pair(finalizedBudgetBroadcast.GetHash(), finalizedBudgetBroadcast));
|
||||
finalizedBudgetBroadcast.Relay();
|
||||
@ -368,6 +370,7 @@ bool CBudgetManager::AddFinalizedBudget(CFinalizedBudget& finalizedBudget)
|
||||
|
||||
bool CBudgetManager::AddProposal(CBudgetProposal& budgetProposal)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
std::string strError = "";
|
||||
if(!budgetProposal.IsValid(strError)) {
|
||||
@ -410,6 +413,7 @@ void CBudgetManager::CheckAndRemove()
|
||||
|
||||
void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||
@ -487,6 +491,7 @@ CBudgetProposal *CBudgetManager::FindProposal(const std::string &strProposalName
|
||||
|
||||
CBudgetProposal *CBudgetManager::FindProposal(uint256 nHash)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
if(mapProposals.count(nHash))
|
||||
@ -539,6 +544,7 @@ bool CBudgetManager::HasNextFinalizedBudget()
|
||||
|
||||
bool CBudgetManager::IsTransactionValid(const CTransaction& txNew, int nBlockHeight)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
int nHighestCount = 0;
|
||||
@ -588,6 +594,7 @@ bool CBudgetManager::IsTransactionValid(const CTransaction& txNew, int nBlockHei
|
||||
|
||||
std::vector<CBudgetProposal*> CBudgetManager::GetAllProposals()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
std::vector<CBudgetProposal*> vBudgetProposalRet;
|
||||
@ -620,6 +627,7 @@ struct sortProposalsByVotes {
|
||||
//Need to review this function
|
||||
std::vector<CBudgetProposal*> CBudgetManager::GetBudget()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
// ------- Sort budgets by Yes Count
|
||||
@ -683,6 +691,7 @@ struct sortFinalizedBudgetsByVotes {
|
||||
|
||||
std::vector<CFinalizedBudget*> CBudgetManager::GetFinalizedBudgets()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
std::vector<CFinalizedBudget*> vFinalizedBudgetsRet;
|
||||
@ -712,6 +721,7 @@ std::vector<CFinalizedBudget*> CBudgetManager::GetFinalizedBudgets()
|
||||
|
||||
std::string CBudgetManager::GetRequiredPaymentsString(int nBlockHeight)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
std::string ret = "unknown-budget";
|
||||
@ -763,6 +773,7 @@ CAmount CBudgetManager::GetTotalBudget(int nHeight)
|
||||
|
||||
void CBudgetManager::NewBlock()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
if (masternodeSync.RequestedMasternodeAssets <= MASTERNODE_SYNC_BUDGET) return;
|
||||
@ -805,6 +816,7 @@ 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
|
||||
@ -957,6 +969,7 @@ bool CBudgetManager::PropExists(uint256 nHash)
|
||||
|
||||
void CBudgetManager::Sync(CNode* pfrom, uint256 nProp)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
/*
|
||||
@ -1021,6 +1034,7 @@ 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)){
|
||||
@ -1048,6 +1062,7 @@ 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)){
|
||||
@ -1175,6 +1190,7 @@ 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();
|
||||
@ -1457,6 +1473,7 @@ 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();
|
||||
@ -1496,6 +1513,7 @@ 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;
|
||||
@ -1566,6 +1584,7 @@ CAmount CFinalizedBudget::GetTotalPayout()
|
||||
|
||||
std::string CFinalizedBudget::GetProposals()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
std::string ret = "";
|
||||
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
|
||||
void CheckOrphanVotes();
|
||||
void Clear(){
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
LogPrintf("Budget object cleared\n");
|
||||
@ -226,6 +227,7 @@ 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();
|
||||
@ -236,6 +238,7 @@ public:
|
||||
}
|
||||
bool GetPayeeAndAmount(int64_t nBlockHeight, CScript& payee, CAmount& nAmount)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs);
|
||||
|
||||
int i = nBlockHeight - GetBlockStart();
|
||||
|
@ -438,6 +438,7 @@ 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();
|
||||
@ -492,6 +493,7 @@ bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerI
|
||||
|
||||
bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_vecPayments);
|
||||
|
||||
int nMaxSignatures = 0;
|
||||
@ -539,6 +541,7 @@ bool CMasternodeBlockPayees::IsTransactionValid(const CTransaction& txNew)
|
||||
|
||||
std::string CMasternodeBlockPayees::GetRequiredPaymentsString()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_vecPayments);
|
||||
|
||||
std::string ret = "Unknown";
|
||||
@ -561,6 +564,7 @@ std::string CMasternodeBlockPayees::GetRequiredPaymentsString()
|
||||
|
||||
std::string CMasternodePayments::GetRequiredPaymentsString(int nBlockHeight)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_mapMasternodeBlocks);
|
||||
|
||||
if(mapMasternodeBlocks.count(nBlockHeight)){
|
||||
@ -572,6 +576,7 @@ 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)){
|
||||
@ -583,6 +588,7 @@ bool CMasternodePayments::IsTransactionValid(const CTransaction& txNew, int nBlo
|
||||
|
||||
void CMasternodePayments::CleanPaymentList()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_mapMasternodePayeeVotes);
|
||||
|
||||
if(chainActive.Tip() == NULL) return;
|
||||
@ -756,6 +762,7 @@ bool CMasternodePaymentWinner::SignatureValid()
|
||||
|
||||
void CMasternodePayments::Sync(CNode* node, int nCountNeeded)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_mapMasternodePayeeVotes);
|
||||
|
||||
if(chainActive.Tip() == NULL) return;
|
||||
@ -791,6 +798,7 @@ std::string CMasternodePayments::ToString() const
|
||||
|
||||
int CMasternodePayments::GetOldestBlock()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_mapMasternodeBlocks);
|
||||
|
||||
int nOldestBlock = std::numeric_limits<int>::max();
|
||||
@ -810,6 +818,7 @@ int CMasternodePayments::GetOldestBlock()
|
||||
|
||||
int CMasternodePayments::GetNewestBlock()
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_mapMasternodeBlocks);
|
||||
|
||||
int nNewestBlock = 0;
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
}
|
||||
|
||||
void AddPayee(CScript payeeIn, int nIncrement){
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_vecPayments);
|
||||
|
||||
BOOST_FOREACH(CMasternodePayee& payee, vecPayments){
|
||||
@ -115,6 +116,7 @@ public:
|
||||
|
||||
bool GetPayee(CScript& payee)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_vecPayments);
|
||||
|
||||
int nVotes = -1;
|
||||
@ -130,6 +132,7 @@ public:
|
||||
|
||||
bool HasPayeeWithVotes(CScript payee, int nVotesReq)
|
||||
{
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK(cs_vecPayments);
|
||||
|
||||
BOOST_FOREACH(CMasternodePayee& p, vecPayments){
|
||||
@ -235,6 +238,7 @@ public:
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
LogPrintf("LOCK - %\n", __func__);
|
||||
LOCK2(cs_mapMasternodeBlocks, cs_mapMasternodePayeeVotes);
|
||||
mapMasternodeBlocks.clear();
|
||||
mapMasternodePayeeVotes.clear();
|
||||
@ -252,6 +256,7 @@ 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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user