aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-11-15 18:47:07 -0800
committerJeff Garzik <jgarzik@exmulti.com>2012-11-15 18:47:07 -0800
commit3ef292dc7db571b9eb35f2148d76bac4ae841796 (patch)
tree4e8d7d0b44bc00959debdce0f0253b3b2d51cfba /src/main.h
parent848c0d5d95b7be098f50a37a046d9c33cea0224f (diff)
parentc34a32699ecfb8b5557922d7674db26771cec6ac (diff)
downloadbitcoin-3ef292dc7db571b9eb35f2148d76bac4ae841796.tar.xz
Merge pull request #1670 from luke-jr/blksubstr
Use full block hash as unique identifier in debug.log
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.h b/src/main.h
index ab341af6fe..8327141266 100644
--- a/src/main.h
+++ b/src/main.h
@@ -174,6 +174,11 @@ CBlockIndex * InsertBlockIndex(uint256 hash);
+static inline std::string BlockHashStr(const uint256& hash)
+{
+ return hash.ToString();
+}
+
bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
class CDiskBlockPos
@@ -1255,9 +1260,9 @@ public:
void print() const
{
printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
- GetHash().ToString().substr(0,20).c_str(),
+ BlockHashStr(GetHash()).c_str(),
nVersion,
- hashPrevBlock.ToString().substr(0,20).c_str(),
+ BlockHashStr(hashPrevBlock).c_str(),
hashMerkleRoot.ToString().substr(0,10).c_str(),
nTime, nBits, nNonce,
vtx.size());
@@ -1568,7 +1573,7 @@ public:
return strprintf("CBlockIndex(pprev=%p, pnext=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, pnext, nHeight,
hashMerkleRoot.ToString().substr(0,10).c_str(),
- GetBlockHash().ToString().substr(0,20).c_str());
+ BlockHashStr(GetBlockHash()).c_str());
}
void print() const
@@ -1649,7 +1654,7 @@ public:
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
GetBlockHash().ToString().c_str(),
- hashPrev.ToString().substr(0,20).c_str());
+ BlockHashStr(hashPrev).c_str());
return str;
}