Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]])
[bitcoinplatinum.git] / src / primitives / block.cpp
blob3774ac3e4b54ec4762a6b491566a7f956fce4070
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #include "primitives/block.h"
8 #include "hash.h"
9 #include "tinyformat.h"
10 #include "utilstrencodings.h"
11 #include "crypto/common.h"
13 uint256 CBlockHeader::GetHash() const
15 return SerializeHash(*this);
18 std::string CBlock::ToString() const
20 std::stringstream s;
21 s << strprintf("CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
22 GetHash().ToString(),
23 nVersion,
24 hashPrevBlock.ToString(),
25 hashMerkleRoot.ToString(),
26 nTime, nBits, nNonce,
27 vtx.size());
28 for (const auto& tx : vtx) {
29 s << " " << tx->ToString() << "\n";
31 return s.str();