Dash Core
0.12.2.1
P2P Digital Currency
block.cpp
Go to the documentation of this file.
1
// Copyright (c) 2009-2010 Satoshi Nakamoto
2
// Copyright (c) 2009-2015 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.
5
6
#include "
primitives/block.h
"
7
8
#include "hash.h"
9
#include "
tinyformat.h
"
10
#include "
utilstrencodings.h
"
11
#include "
crypto/common.h
"
12
13
uint256
CBlockHeader::GetHash
()
const
14
{
15
return
HashX11
(
BEGIN
(
nVersion
),
END
(
nNonce
));
16
}
17
18
std::string
CBlock::ToString
()
const
19
{
20
std::stringstream s;
21
s <<
strprintf
(
"CBlock(hash=%s, ver=%d, 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
(
unsigned
int
i = 0; i <
vtx
.size(); i++)
29
{
30
s <<
" "
<<
vtx
[i].ToString() <<
"\n"
;
31
}
32
return
s.str();
33
}
CBlockHeader::hashMerkleRoot
uint256 hashMerkleRoot
Definition:
block.h:26
strprintf
#define strprintf
Definition:
tinyformat.h:1011
CBlockHeader::nTime
uint32_t nTime
Definition:
block.h:27
CBlock::vtx
std::vector< CTransaction > vtx
Definition:
block.h:77
CBlockHeader::hashPrevBlock
uint256 hashPrevBlock
Definition:
block.h:25
BEGIN
#define BEGIN(a)
Definition:
utilstrencodings.h:16
utilstrencodings.h
CBlockHeader::nBits
uint32_t nBits
Definition:
block.h:28
END
#define END(a)
Definition:
utilstrencodings.h:17
tinyformat.h
base_blob::ToString
std::string ToString() const
Definition:
uint256.cpp:65
CBlock::ToString
std::string ToString() const
Definition:
block.cpp:18
uint256
Definition:
uint256.h:114
CBlockHeader::nNonce
uint32_t nNonce
Definition:
block.h:29
CBlockHeader::nVersion
int32_t nVersion
Definition:
block.h:24
common.h
CBlockHeader::GetHash
uint256 GetHash() const
Definition:
block.cpp:13
HashX11
uint256 HashX11(const T1 pbegin, const T1 pend)
Definition:
hash.h:283
block.h
src
primitives
block.cpp
Generated on Thu Dec 14 2017 13:15:04 for Dash Core by
1.8.14