Merge pull request #2478 from sipa/fullhash

Always print full hashes (tx, block, inv)
This commit is contained in:
Gavin Andresen
2013-04-09 10:57:16 -07:00
6 changed files with 44 additions and 54 deletions

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);
struct CDiskBlockPos
@@ -301,7 +296,7 @@ public:
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
@@ -635,7 +630,7 @@ public:
{
std::string str;
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,
vin.size(),
vout.size(),
@@ -1472,10 +1467,10 @@ public:
void print() const
{
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,
BlockHashStr(hashPrevBlock).c_str(),
hashMerkleRoot.ToString().substr(0,10).c_str(),
hashPrevBlock.ToString().c_str(),
hashMerkleRoot.ToString().c_str(),
nTime, nBits, nNonce,
vtx.size());
for (unsigned int i = 0; i < vtx.size(); i++)
@@ -1485,7 +1480,7 @@ public:
}
printf(" vMerkleTree: ");
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");
}
@@ -1785,8 +1780,8 @@ public:
{
return strprintf("CBlockIndex(pprev=%p, pnext=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, pnext, nHeight,
hashMerkleRoot.ToString().substr(0,10).c_str(),
BlockHashStr(GetBlockHash()).c_str());
hashMerkleRoot.ToString().c_str(),
GetBlockHash().ToString().c_str());
}
void print() const
@@ -1867,7 +1862,7 @@ public:
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
GetBlockHash().ToString().c_str(),
BlockHashStr(hashPrev).c_str());
hashPrev.ToString().c_str());
return str;
}