LogPrintf the removed txs

This commit is contained in:
blackjok3r
2018-11-11 15:57:40 +08:00
parent 4d6499bd8d
commit 2e91034c1e

View File

@@ -1058,7 +1058,6 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp)
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
fprintf(stderr, "[%s] depth : %d\n", wtx.GetHash().ToString().c_str(),wtx.GetDepthInMainChain());
if (!CheckFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 360 )
continue;
@@ -1077,13 +1076,11 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp)
{
for (unsigned int n = 0; n < wtx.vin.size() ; n++)
{
//if ( pwalletMain->IsMine(wtx.vin[n]) )
CTransaction vintx; uint256 hashBlock;
if ( GetTransaction(wtx.vin[n].prevout.hash,vintx,hashBlock,false) != 0 )
{
for (unsigned int z = 0; z < vintx.vin.size() ; z++)
{
fprintf(stderr, "TX: %s in block : %s\n", vintx.GetHash().ToString().c_str(),hashBlock.ToString().c_str());
TxToRemove.push_back(vintx.vin[z].prevout.hash);
}
}
@@ -1112,7 +1109,7 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp)
if ( SpentHash == tx.vin[n].prevout.hash )
{
pwalletMain->EraseFromWallet(tx.GetHash());
//fprintf(stderr, "ERASED Notarisation: %s\n",tx.GetHash().ToString().c_str());
LogPrintf("ERASED Notarisation: %s\n",tx.GetHash().ToString().c_str());
}
}
}
@@ -1123,7 +1120,7 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp)
BOOST_FOREACH (uint256& hash, TxToRemove)
{
pwalletMain->EraseFromWallet(hash);
//fprintf(stderr, "ERASED spent Tx: %s\n",hash.ToString().c_str());
LogPrintf("ERASED spent Tx: %s\n",hash.ToString().c_str());
}
// build return JSON for stats.