Skip to content

Commit

Permalink
Remove debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockMechanic committed Apr 12, 2022
1 parent be4bd86 commit bc7398b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
12 changes: 0 additions & 12 deletions src/crown/nodewallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,17 @@ bool NodeWallet::CreateCoinStake(const int nHeight, const uint32_t& nBits, const
template <typename stakingnode>
bool GetPointers(stakingnode* pstaker, std::vector<StakePointer>& vStakePointers, int nPaymentSlot)
{
LogPrintf("%s: 1\n", __func__);
bool found = false;
// get block index of last mn payment
std::vector<const CBlockIndex*> vBlocksLastPaid;
if (!pstaker->GetRecentPaymentBlocks(vBlocksLastPaid, false)) {
LogPrintf("GetRecentStakePointer -- Couldn't find last paid block\n");
return false;
}
LogPrintf("%s: 2\n", __func__);
int nBestHeight = ::ChainActive().Height();
for (auto pindex : vBlocksLastPaid) {
if (budget.IsBudgetPaymentBlock(pindex->nHeight))
continue;
LogPrintf("%s: 2.1\n", __func__);

// Pointer has to be at least deeper than the max reorg depth
const int nMaxReorganizationDepth = 100;
Expand All @@ -258,22 +255,16 @@ bool GetPointers(stakingnode* pstaker, std::vector<StakePointer>& vStakePointers
LogPrintf("GetRecentStakePointer -- Failed reading block from disk\n");
return false;
}
LogPrintf("%s: 2.2\n", __func__);

CScript scriptMNPubKey;
scriptMNPubKey = GetScriptForDestination(PKHash(pstaker->pubkey));
LogPrintf("%s: 2.3\n", __func__);

for (auto& tx : blockLastPaid.vtx) {
LogPrintf("%s: 2.4.0\n", __func__);

auto stakeSource = COutPoint(tx->GetHash(), nPaymentSlot);
uint256 hashPointer = stakeSource.GetHash();
if (mapUsedStakePointers.count(hashPointer))
continue;

LogPrintf("%s: 2.4.1\n", __func__);

if (tx->IsCoinBase()) {
CTxOutAsset mout = (tx->nVersion >= TX_ELE_VERSION ? tx->vpout[nPaymentSlot] : tx->vout[nPaymentSlot]);
if(mout.scriptPubKey == scriptMNPubKey){
Expand All @@ -287,11 +278,8 @@ bool GetPointers(stakingnode* pstaker, std::vector<StakePointer>& vStakePointers
continue;
}
}
LogPrintf("%s: 2.4.2\n", __func__);

}
}
LogPrintf("%s: 3\n", __func__);
return found;
}

Expand Down
7 changes: 4 additions & 3 deletions src/qt/transactionrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
//
// Credit
//
for(unsigned int i = 0; i < wtx.tx->vout.size(); i++)
{
const CTxOut& txout = wtx.tx->vout[i];
for (unsigned int i = 0; i < (wtx.tx->nVersion >= TX_ELE_VERSION ? wtx.tx->vpout.size() : wtx.tx->vout.size()); i++) {
CTxOutAsset txout = (wtx.tx->nVersion >= TX_ELE_VERSION ? wtx.tx->vpout[i] : wtx.tx->vout[i]);

//const CTxOut& txout = wtx.tx->vout[i];
const CAsset& asset = wtx.txout_assets[i];
if (txout.IsFee()) {
// explicit fee; ignore
Expand Down

0 comments on commit bc7398b

Please sign in to comment.