Bitcoin ABC
0.31.0
P2P Digital Currency
Toggle main menu visibility
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
f
g
h
i
k
m
n
o
p
s
t
u
v
w
Typedefs
Enumerations
Enumerator
a
b
c
d
e
h
i
l
m
n
p
q
r
s
t
u
v
w
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
!
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
!
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
m
n
o
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
f
g
i
o
p
r
s
t
u
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
b
c
d
e
h
i
k
l
m
n
p
r
s
t
u
v
Enumerations
b
c
d
e
f
g
h
i
j
m
n
o
p
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
x
y
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
primitives
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
// 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
11
BlockHash
CBlockHeader::GetHash
()
const
{
12
return
BlockHash
(
SerializeHash
(*
this
));
13
}
14
15
std::string
CBlock::ToString
()
const
{
16
std::stringstream s;
17
s <<
strprintf
(
"CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, "
18
"hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, "
19
"vtx=%u)\n"
,
20
GetHash
().
ToString
(),
nVersion
,
hashPrevBlock
.
ToString
(),
21
hashMerkleRoot
.
ToString
(),
nTime
,
nBits
,
nNonce
,
vtx
.size());
22
for
(
const
auto
&tx :
vtx
) {
23
s <<
" "
<< tx->ToString() <<
"\n"
;
24
}
25
return
s.str();
26
}
block.h
CBlockHeader::GetHash
BlockHash GetHash() const
Definition:
block.cpp:11
CBlockHeader::nNonce
uint32_t nNonce
Definition:
block.h:31
CBlockHeader::nBits
uint32_t nBits
Definition:
block.h:30
CBlockHeader::nTime
uint32_t nTime
Definition:
block.h:29
CBlockHeader::hashPrevBlock
BlockHash hashPrevBlock
Definition:
block.h:27
CBlockHeader::nVersion
int32_t nVersion
Definition:
block.h:26
CBlockHeader::hashMerkleRoot
uint256 hashMerkleRoot
Definition:
block.h:28
CBlock::ToString
std::string ToString() const
Definition:
block.cpp:15
CBlock::vtx
std::vector< CTransactionRef > vtx
Definition:
block.h:63
base_blob::ToString
std::string ToString() const
Definition:
uint256.h:80
SerializeHash
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
Definition:
hash.h:225
BlockHash
A BlockHash is a unqiue identifier for a block.
Definition:
blockhash.h:13
tinyformat.h
strprintf
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition:
tinyformat.h:1202
Generated on Mon Apr 7 2025 17:20:21 for Bitcoin ABC by
1.9.4