diff --git a/src/masternode/masternode-budget.cpp b/src/masternode/masternode-budget.cpp index 7747b9f..b2623b6 100755 --- a/src/masternode/masternode-budget.cpp +++ b/src/masternode/masternode-budget.cpp @@ -113,19 +113,15 @@ int GetNextSuperblock(int height) bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, std::string& strError, int64_t& nTime, int& nConf) { uint256 nBlockHash; - CTransactionRef txCollateral = GetTransaction(nullptr, nullptr, nTxCollateralHash, Params().GetConsensus(), nBlockHash); + CBlockIndex* blockindex = nullptr; + + CTransactionRef txCollateral = GetTransaction(blockindex, g_mempool, nTxCollateralHash, Params().GetConsensus(), nBlockHash); if(!txCollateral){ strError = strprintf("Can't find collateral tx %s", nTxCollateralHash.ToString()); LogPrintf ("CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); return false; } - if(txCollateral->nVersion >= TX_ELE_VERSION) - if(txCollateral->vpout.size() < 1) return false; - else - if(txCollateral->vout.size() < 1) return false; - - if(txCollateral->nLockTime != 0) return false; CScript findScript; findScript << OP_RETURN << ToByteVector(nExpectedHash); @@ -138,7 +134,8 @@ bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, s LogPrintf ("CBudgetProposalBroadcast::IsBudgetCollateralValid - %s\n", strError); return false; } - if(o.scriptPubKey == findScript && o.nValue >= BUDGET_FEE_TX) foundOpReturn = true; + + if(o.scriptPubKey[0] == OP_RETURN && o.nValue >= BUDGET_FEE_TX) foundOpReturn = true; } if(!foundOpReturn){ @@ -307,8 +304,8 @@ void CBudgetManager::SubmitBudgetDraft() int conf = GetIXConfirmations(tx->GetHash()); uint256 nBlockHash; - - CTransactionRef txCollateral = GetTransaction(nullptr, nullptr, txidCollateral, Params().GetConsensus(), nBlockHash); + CBlockIndex* blockindex = nullptr; + CTransactionRef txCollateral = GetTransaction(blockindex, nullptr, txidCollateral, Params().GetConsensus(), nBlockHash); if(!txCollateral) { LogPrintf ("CBudgetManager::SubmitBudgetDraft - Can't find collateral tx %s", txidCollateral.ToString()); @@ -464,7 +461,7 @@ void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees) c txNew.vpout[0].nValue = GetBlockSubsidy(pindexPrev->nHeight, Params().GetConsensus()); else txNew.vout[0].nValue = GetBlockSubsidy(pindexPrev->nHeight, Params().GetConsensus()); - + // Find finalized budgets with the most votes diff --git a/src/masternode/masternode.cpp b/src/masternode/masternode.cpp index 675fe67..3faf017 100755 --- a/src/masternode/masternode.cpp +++ b/src/masternode/masternode.cpp @@ -704,7 +704,8 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS) const // verify that sig time is legit in past // should be at least not earlier than block when 10000 CRW tx got MASTERNODE_MIN_CONFIRMATIONS uint256 hashBlock = uint256(); - CTransactionRef tx2 = GetTransaction(nullptr, nullptr, vin.prevout.hash, Params().GetConsensus(), hashBlock); + CBlockIndex* blockindex = nullptr; + CTransactionRef tx2 = GetTransaction(blockindex, nullptr, vin.prevout.hash, Params().GetConsensus(), hashBlock); BlockMap::iterator mi = g_chainman.m_blockman.m_block_index.find(hashBlock); if (mi != g_chainman.m_blockman.m_block_index.end() && (*mi).second) { diff --git a/src/systemnode/systemnode.cpp b/src/systemnode/systemnode.cpp index 1d63e39..ba3f93a 100755 --- a/src/systemnode/systemnode.cpp +++ b/src/systemnode/systemnode.cpp @@ -620,7 +620,8 @@ bool CSystemnodeBroadcast::CheckInputsAndAdd(int& nDoS) const // verify that sig time is legit in past // should be at least not earlier than block when 10000 CRW tx got SYSTEMNODE_MIN_CONFIRMATIONS uint256 hashBlock = uint256(); - CTransactionRef tx2 = GetTransaction(nullptr, nullptr, vin.prevout.hash, Params().GetConsensus(), hashBlock);; + CBlockIndex* blockindex = nullptr; + CTransactionRef tx2 = GetTransaction(blockindex, nullptr, vin.prevout.hash, Params().GetConsensus(), hashBlock);; BlockMap::iterator mi = g_chainman.m_blockman.m_block_index.find(hashBlock); if (mi != g_chainman.m_blockman.m_block_index.end() && (*mi).second) { diff --git a/src/validation.cpp b/src/validation.cpp index be24663..ba4aab1 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2754,13 +2754,13 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, //Asset DB { for(unsigned int i = 0; i < block.vtx.size(); i++){ - LogPrintf("TRANSACTION: \n %s\n", block.vtx[i]->ToString()); + //LogPrintf("TRANSACTION: \n %s\n", block.vtx[i]->ToString()); if(block.vtx[i]->nVersion >= TX_ELE_VERSION ){ for(unsigned int j = 0; j < block.vtx[i]->vpout.size(); j++){ CAsset out = block.vtx[i]->vpout[j].nAsset; bool exists = false; - LogPrintf("%s: FOUND ASSET %s \n", __func__, out.ToString()); + //LogPrintf("%s: FOUND ASSET %s \n", __func__, out.ToString()); for(auto const& x : passetsCache->GetItemsMap()){ CAsset checkasset = x.second->second.asset; @@ -2768,8 +2768,8 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, exists = true; } - if (exists) - LogPrintf("%s: EXISTS ASSET %s.\n", __func__, out.getAssetName()); + //if (exists) + // LogPrintf("%s: EXISTS ASSET %s.\n", __func__, out.getAssetName()); if (!exists && !passetsCache->Exists(out.getAssetName())){ if(!fJustCheck){