Raven Core  3.0.0
P2P Digital Currency
block.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2019 The Raven Core developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #include "primitives/block.h"
8 
9 #include "hash.h"
10 #include "tinyformat.h"
11 #include "utilstrencodings.h"
12 #include "crypto/common.h"
13 
15 {
17 }
18 
19 std::string CBlock::ToString() const
20 {
21  std::stringstream s;
22  s << strprintf("CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
23  GetHash().ToString(),
24  nVersion,
27  nTime, nBits, nNonce,
28  vtx.size());
29  for (const auto& tx : vtx) {
30  s << " " << tx->ToString() << "\n";
31  }
32  return s.str();
33 }
uint32_t nNonce
Definition: block.h:30
#define strprintf
Definition: tinyformat.h:1054
std::string ToString() const
Definition: block.cpp:19
uint32_t nTime
Definition: block.h:28
uint256 HashX16R(const T1 pbegin, const T1 pend, const uint256 PrevBlockHash)
Definition: hash.h:361
#define BEGIN(a)
Utilities for converting data from/to strings.
uint256 hashMerkleRoot
Definition: block.h:27
uint256 hashPrevBlock
Definition: block.h:26
#define END(a)
std::string ToString() const
Definition: uint256.cpp:63
uint256 GetHash() const
Definition: block.cpp:14
256-bit opaque blob.
Definition: uint256.h:123
int32_t nVersion
Definition: block.h:25
uint32_t nBits
Definition: block.h:29