Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/block.cpp
Show All 15 Lines | |||||
std::string CBlock::ToString() const { | std::string CBlock::ToString() const { | ||||
std::stringstream s; | std::stringstream s; | ||||
s << strprintf("CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, " | s << strprintf("CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, " | ||||
"hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, " | "hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, " | ||||
"vtx=%u)\n", | "vtx=%u)\n", | ||||
GetHash().ToString(), nVersion, hashPrevBlock.ToString(), | GetHash().ToString(), nVersion, hashPrevBlock.ToString(), | ||||
hashMerkleRoot.ToString(), nTime, nBits, nNonce, vtx.size()); | hashMerkleRoot.ToString(), nTime, nBits, nNonce, vtx.size()); | ||||
for (unsigned int i = 0; i < vtx.size(); i++) { | for (const auto &tx : vtx) { | ||||
s << " " << vtx[i]->ToString() << "\n"; | s << " " << tx->ToString() << "\n"; | ||||
} | } | ||||
return s.str(); | return s.str(); | ||||
} | } |