Always print full hashes (tx, block, inv)

This commit is contained in:
Pieter Wuille 2013-04-07 03:40:33 +02:00
parent ab806a69a2
commit 1c06aa98c6
6 changed files with 44 additions and 54 deletions

View File

@ -297,7 +297,7 @@ bool AddOrphanTx(const CDataStream& vMsg)
// at most 500 megabytes of orphans: // at most 500 megabytes of orphans:
if (pvMsg->size() > 5000) if (pvMsg->size() > 5000)
{ {
printf("ignoring large orphan tx (size: %"PRIszu", hash: %s)\n", pvMsg->size(), hash.ToString().substr(0,10).c_str()); printf("ignoring large orphan tx (size: %"PRIszu", hash: %s)\n", pvMsg->size(), hash.ToString().c_str());
delete pvMsg; delete pvMsg;
return false; return false;
} }
@ -306,7 +306,7 @@ bool AddOrphanTx(const CDataStream& vMsg)
BOOST_FOREACH(const CTxIn& txin, tx.vin) BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev[txin.prevout.hash].insert(make_pair(hash, pvMsg)); mapOrphanTransactionsByPrev[txin.prevout.hash].insert(make_pair(hash, pvMsg));
printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().substr(0,10).c_str(), printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().c_str(),
mapOrphanTransactions.size()); mapOrphanTransactions.size());
return true; return true;
} }
@ -770,7 +770,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// This is done last to help prevent CPU exhaustion denial-of-service attacks. // This is done last to help prevent CPU exhaustion denial-of-service attacks.
if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH)) if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH))
{ {
return error("CTxMemPool::accept() : ConnectInputs failed %s", hash.ToString().substr(0,10).c_str()); return error("CTxMemPool::accept() : ConnectInputs failed %s", hash.ToString().c_str());
} }
} }
@ -792,7 +792,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
SyncWithWallets(hash, tx, NULL, true); SyncWithWallets(hash, tx, NULL, true);
printf("CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n", printf("CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n",
hash.ToString().substr(0,10).c_str(), hash.ToString().c_str(),
mapTx.size()); mapTx.size());
return true; return true;
} }
@ -1198,11 +1198,11 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
uiInterface.NotifyBlocksChanged(); uiInterface.NotifyBlocksChanged();
} }
printf("InvalidChainFound: invalid block=%s height=%d work=%s date=%s\n", printf("InvalidChainFound: invalid block=%s height=%d work=%s date=%s\n",
BlockHashStr(pindexNew->GetBlockHash()).c_str(), pindexNew->nHeight, pindexNew->GetBlockHash().ToString().c_str(), pindexNew->nHeight,
pindexNew->bnChainWork.ToString().c_str(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexNew->bnChainWork.ToString().c_str(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S",
pindexNew->GetBlockTime()).c_str()); pindexNew->GetBlockTime()).c_str());
printf("InvalidChainFound: current best=%s height=%d work=%s date=%s\n", printf("InvalidChainFound: current best=%s height=%d work=%s date=%s\n",
BlockHashStr(hashBestChain).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), hashBestChain.ToString().c_str(), nBestHeight, bnBestChainWork.ToString().c_str(),
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str()); DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str());
if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6)
printf("InvalidChainFound: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n"); printf("InvalidChainFound: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n");
@ -1366,7 +1366,7 @@ bool CTransaction::HaveInputs(CCoinsViewCache &inputs) const
bool CScriptCheck::operator()() const { bool CScriptCheck::operator()() const {
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType)) if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType))
return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString().substr(0,10).c_str()); return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString().c_str());
return true; return true;
} }
@ -1385,7 +1385,7 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs,
// This doesn't trigger the DoS code on purpose; if it did, it would make it easier // This doesn't trigger the DoS code on purpose; if it did, it would make it easier
// for an attacker to attempt to split the network. // for an attacker to attempt to split the network.
if (!HaveInputs(inputs)) if (!HaveInputs(inputs))
return state.Invalid(error("CheckInputs() : %s inputs unavailable", GetHash().ToString().substr(0,10).c_str())); return state.Invalid(error("CheckInputs() : %s inputs unavailable", GetHash().ToString().c_str()));
// While checking, GetBestBlock() refers to the parent block. // While checking, GetBestBlock() refers to the parent block.
// This is also true for mempool checks. // This is also true for mempool checks.
@ -1411,12 +1411,12 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs,
} }
if (nValueIn < GetValueOut()) if (nValueIn < GetValueOut())
return state.DoS(100, error("CheckInputs() : %s value in < value out", GetHash().ToString().substr(0,10).c_str())); return state.DoS(100, error("CheckInputs() : %s value in < value out", GetHash().ToString().c_str()));
// Tally transaction fees // Tally transaction fees
int64 nTxFee = nValueIn - GetValueOut(); int64 nTxFee = nValueIn - GetValueOut();
if (nTxFee < 0) if (nTxFee < 0)
return state.DoS(100, error("CheckInputs() : %s nTxFee < 0", GetHash().ToString().substr(0,10).c_str())); return state.DoS(100, error("CheckInputs() : %s nTxFee < 0", GetHash().ToString().c_str()));
nFees += nTxFee; nFees += nTxFee;
if (!MoneyRange(nFees)) if (!MoneyRange(nFees))
return state.DoS(100, error("CheckInputs() : nFees out of range")); return state.DoS(100, error("CheckInputs() : nFees out of range"));
@ -1750,8 +1750,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse(vConnect.begin(), vConnect.end()); reverse(vConnect.begin(), vConnect.end());
if (vDisconnect.size() > 0) { if (vDisconnect.size() > 0) {
printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..%s\n", vDisconnect.size(), BlockHashStr(pfork->GetBlockHash()).c_str(), BlockHashStr(pindexBest->GetBlockHash()).c_str()); printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %"PRIszu" blocks; %s..%s\n", vConnect.size(), BlockHashStr(pfork->GetBlockHash()).c_str(), BlockHashStr(pindexNew->GetBlockHash()).c_str()); printf("REORGANIZE: Connect %"PRIszu" blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
} }
// Disconnect shorter branch // Disconnect shorter branch
@ -1762,7 +1762,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
return state.Abort(_("Failed to read block")); return state.Abort(_("Failed to read block"));
int64 nStart = GetTimeMicros(); int64 nStart = GetTimeMicros();
if (!block.DisconnectBlock(state, pindex, view)) if (!block.DisconnectBlock(state, pindex, view))
return error("SetBestBlock() : DisconnectBlock %s failed", BlockHashStr(pindex->GetBlockHash()).c_str()); return error("SetBestBlock() : DisconnectBlock %s failed", pindex->GetBlockHash().ToString().c_str());
if (fBenchmark) if (fBenchmark)
printf("- Disconnect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); printf("- Disconnect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001);
@ -1786,7 +1786,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
InvalidChainFound(pindexNew); InvalidChainFound(pindexNew);
InvalidBlockFound(pindex); InvalidBlockFound(pindex);
} }
return error("SetBestBlock() : ConnectBlock %s failed", BlockHashStr(pindex->GetBlockHash()).c_str()); return error("SetBestBlock() : ConnectBlock %s failed", pindex->GetBlockHash().ToString().c_str());
} }
if (fBenchmark) if (fBenchmark)
printf("- Connect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); printf("- Connect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001);
@ -1862,7 +1862,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
nTimeBestReceived = GetTime(); nTimeBestReceived = GetTime();
nTransactionsUpdated++; nTransactionsUpdated++;
printf("SetBestChain: new best=%s height=%d work=%s tx=%lu date=%s progress=%f\n", printf("SetBestChain: new best=%s height=%d work=%s tx=%lu date=%s progress=%f\n",
BlockHashStr(hashBestChain).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), (unsigned long)pindexNew->nChainTx, hashBestChain.ToString().c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), (unsigned long)pindexNew->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str(),
Checkpoints::GuessVerificationProgress(pindexBest)); Checkpoints::GuessVerificationProgress(pindexBest));
@ -1901,7 +1901,7 @@ bool CBlock::AddToBlockIndex(CValidationState &state, const CDiskBlockPos &pos)
// Check for duplicate // Check for duplicate
uint256 hash = GetHash(); uint256 hash = GetHash();
if (mapBlockIndex.count(hash)) if (mapBlockIndex.count(hash))
return state.Invalid(error("AddToBlockIndex() : %s already exists", BlockHashStr(hash).c_str())); return state.Invalid(error("AddToBlockIndex() : %s already exists", hash.ToString().c_str()));
// Construct new block index object // Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(*this); CBlockIndex* pindexNew = new CBlockIndex(*this);
@ -2222,9 +2222,9 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl
// Check for duplicate // Check for duplicate
uint256 hash = pblock->GetHash(); uint256 hash = pblock->GetHash();
if (mapBlockIndex.count(hash)) if (mapBlockIndex.count(hash))
return state.Invalid(error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, BlockHashStr(hash).c_str())); return state.Invalid(error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString().c_str()));
if (mapOrphanBlocks.count(hash)) if (mapOrphanBlocks.count(hash))
return state.Invalid(error("ProcessBlock() : already have block (orphan) %s", BlockHashStr(hash).c_str())); return state.Invalid(error("ProcessBlock() : already have block (orphan) %s", hash.ToString().c_str()));
// Preliminary checks // Preliminary checks
if (!pblock->CheckBlock(state)) if (!pblock->CheckBlock(state))
@ -2253,7 +2253,7 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl
// If we don't already have its previous block, shunt it off to holding area until we get it // If we don't already have its previous block, shunt it off to holding area until we get it
if (pblock->hashPrevBlock != 0 && !mapBlockIndex.count(pblock->hashPrevBlock)) if (pblock->hashPrevBlock != 0 && !mapBlockIndex.count(pblock->hashPrevBlock))
{ {
printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", BlockHashStr(pblock->hashPrevBlock).c_str()); printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().c_str());
// Accept orphans as long as there is a node to request its parents from // Accept orphans as long as there is a node to request its parents from
if (pfrom) { if (pfrom) {
@ -2589,7 +2589,7 @@ bool static LoadBlockIndexDB()
pindex = pindexPrev; pindex = pindexPrev;
} }
printf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s\n", printf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s\n",
BlockHashStr(hashBestChain).c_str(), nBestHeight, hashBestChain.ToString().c_str(), nBestHeight,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str()); DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexBest->GetBlockTime()).c_str());
return true; return true;
@ -3426,12 +3426,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (pindex) if (pindex)
pindex = pindex->pnext; pindex = pindex->pnext;
int nLimit = 500; int nLimit = 500;
printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), BlockHashStr(hashStop).c_str(), nLimit); printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().c_str(), nLimit);
for (; pindex; pindex = pindex->pnext) for (; pindex; pindex = pindex->pnext)
{ {
if (pindex->GetBlockHash() == hashStop) if (pindex->GetBlockHash() == hashStop)
{ {
printf(" getblocks stopping at %d %s\n", pindex->nHeight, BlockHashStr(pindex->GetBlockHash()).c_str()); printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());
break; break;
} }
pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash())); pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash()));
@ -3439,7 +3439,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{ {
// When this block is requested, we'll send an inv that'll make them // When this block is requested, we'll send an inv that'll make them
// getblocks the next batch of inventory. // getblocks the next batch of inventory.
printf(" getblocks stopping at limit %d %s\n", pindex->nHeight, BlockHashStr(pindex->GetBlockHash()).c_str()); printf(" getblocks stopping at limit %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());
pfrom->hashContinue = pindex->GetBlockHash(); pfrom->hashContinue = pindex->GetBlockHash();
break; break;
} }
@ -3473,7 +3473,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end
vector<CBlock> vHeaders; vector<CBlock> vHeaders;
int nLimit = 2000; int nLimit = 2000;
printf("getheaders %d to %s\n", (pindex ? pindex->nHeight : -1), BlockHashStr(hashStop).c_str()); printf("getheaders %d to %s\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().c_str());
for (; pindex; pindex = pindex->pnext) for (; pindex; pindex = pindex->pnext)
{ {
vHeaders.push_back(pindex->GetBlockHeader()); vHeaders.push_back(pindex->GetBlockHeader());
@ -3522,7 +3522,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (tx.AcceptToMemoryPool(stateDummy, true, true, &fMissingInputs2)) if (tx.AcceptToMemoryPool(stateDummy, true, true, &fMissingInputs2))
{ {
printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str()); printf(" accepted orphan tx %s\n", inv.hash.ToString().c_str());
RelayTransaction(tx, inv.hash, vMsg); RelayTransaction(tx, inv.hash, vMsg);
mapAlreadyAskedFor.erase(inv); mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash); vWorkQueue.push_back(inv.hash);
@ -3532,7 +3532,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{ {
// invalid or too-little-fee orphan // invalid or too-little-fee orphan
vEraseQueue.push_back(inv.hash); vEraseQueue.push_back(inv.hash);
printf(" removed orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str()); printf(" removed orphan tx %s\n", inv.hash.ToString().c_str());
} }
} }
} }
@ -3560,7 +3560,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CBlock block; CBlock block;
vRecv >> block; vRecv >> block;
printf("received block %s\n", BlockHashStr(block.GetHash()).c_str()); printf("received block %s\n", block.GetHash().ToString().c_str());
// block.print(); // block.print();
CInv inv(MSG_BLOCK, block.GetHash()); CInv inv(MSG_BLOCK, block.GetHash());
@ -4107,9 +4107,9 @@ public:
void print() const void print() const
{ {
printf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n", printf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n",
ptx->GetHash().ToString().substr(0,10).c_str(), dPriority, dFeePerKb); ptx->GetHash().ToString().c_str(), dPriority, dFeePerKb);
BOOST_FOREACH(uint256 hash, setDependsOn) BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str()); printf(" setDependsOn %s\n", hash.ToString().c_str());
} }
}; };

View File

@ -195,11 +195,6 @@ bool AbortNode(const std::string &msg);
static inline std::string BlockHashStr(const uint256& hash)
{
return hash.ToString();
}
bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut); bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
struct CDiskBlockPos struct CDiskBlockPos
@ -301,7 +296,7 @@ public:
std::string ToString() const std::string ToString() const
{ {
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10).c_str(), n); return strprintf("COutPoint(%s, %u)", hash.ToString().c_str(), n);
} }
void print() const void print() const
@ -635,7 +630,7 @@ public:
{ {
std::string str; std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n", str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n",
GetHash().ToString().substr(0,10).c_str(), GetHash().ToString().c_str(),
nVersion, nVersion,
vin.size(), vin.size(),
vout.size(), vout.size(),
@ -1472,10 +1467,10 @@ public:
void print() const void print() const
{ {
printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n", printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
BlockHashStr(GetHash()).c_str(), GetHash().ToString().c_str(),
nVersion, nVersion,
BlockHashStr(hashPrevBlock).c_str(), hashPrevBlock.ToString().c_str(),
hashMerkleRoot.ToString().substr(0,10).c_str(), hashMerkleRoot.ToString().c_str(),
nTime, nBits, nNonce, nTime, nBits, nNonce,
vtx.size()); vtx.size());
for (unsigned int i = 0; i < vtx.size(); i++) for (unsigned int i = 0; i < vtx.size(); i++)
@ -1485,7 +1480,7 @@ public:
} }
printf(" vMerkleTree: "); printf(" vMerkleTree: ");
for (unsigned int i = 0; i < vMerkleTree.size(); i++) for (unsigned int i = 0; i < vMerkleTree.size(); i++)
printf("%s ", vMerkleTree[i].ToString().substr(0,10).c_str()); printf("%s ", vMerkleTree[i].ToString().c_str());
printf("\n"); printf("\n");
} }
@ -1785,8 +1780,8 @@ public:
{ {
return strprintf("CBlockIndex(pprev=%p, pnext=%p, nHeight=%d, merkle=%s, hashBlock=%s)", return strprintf("CBlockIndex(pprev=%p, pnext=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, pnext, nHeight, pprev, pnext, nHeight,
hashMerkleRoot.ToString().substr(0,10).c_str(), hashMerkleRoot.ToString().c_str(),
BlockHashStr(GetBlockHash()).c_str()); GetBlockHash().ToString().c_str());
} }
void print() const void print() const
@ -1867,7 +1862,7 @@ public:
str += CBlockIndex::ToString(); str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)", str += strprintf("\n hashBlock=%s, hashPrev=%s)",
GetBlockHash().ToString().c_str(), GetBlockHash().ToString().c_str(),
BlockHashStr(hashPrev).c_str()); hashPrev.ToString().c_str());
return str; return str;
} }

View File

@ -142,12 +142,7 @@ const char* CInv::GetCommand() const
std::string CInv::ToString() const std::string CInv::ToString() const
{ {
if (type == MSG_BLOCK) return strprintf("%s %s", GetCommand(), hash.ToString().c_str());
return strprintf("%s %s", GetCommand(), BlockHashStr(hash).c_str());
if (type == MSG_TX)
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,10).c_str());
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
} }
void CInv::print() const void CInv::print() const

View File

@ -420,7 +420,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
} }
else else
printf("AddToWallet() : found %s in block %s not in index\n", printf("AddToWallet() : found %s in block %s not in index\n",
wtxIn.GetHash().ToString().substr(0,10).c_str(), wtxIn.GetHash().ToString().c_str(),
wtxIn.hashBlock.ToString().c_str()); wtxIn.hashBlock.ToString().c_str());
} }
} }
@ -449,7 +449,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
} }
//// debug print //// debug print
printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : "")); printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
// Write to disk // Write to disk
if (fInsertedNew || fUpdated) if (fInsertedNew || fUpdated)
@ -845,7 +845,7 @@ void CWalletTx::RelayWalletTransaction()
{ {
if (GetDepthInMainChain() == 0) { if (GetDepthInMainChain() == 0) {
uint256 hash = GetHash(); uint256 hash = GetHash();
printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str()); printf("Relaying wtx %s\n", hash.ToString().c_str());
RelayTransaction((CTransaction)*this, hash); RelayTransaction((CTransaction)*this, hash);
} }
} }

View File

@ -704,7 +704,7 @@ public:
std::string ToString() const std::string ToString() const
{ {
return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().substr(0,10).c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str());
} }
void print() const void print() const

View File

@ -240,7 +240,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
//printf(" %12"PRI64d" %s %s %s\n", //printf(" %12"PRI64d" %s %s %s\n",
// wtx.vout[0].nValue, // wtx.vout[0].nValue,
// DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(), // DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(),
// wtx.hashBlock.ToString().substr(0,20).c_str(), // wtx.hashBlock.ToString().c_str(),
// wtx.mapValue["message"].c_str()); // wtx.mapValue["message"].c_str());
} }
else if (strType == "acentry") else if (strType == "acentry")