6#ifndef BFI_BITCOIN_BLOCK_HPP
7#define BFI_BITCOIN_BLOCK_HPP
10#include <veriblock/bfi/bitcoin/serialize.hpp>
11#include <veriblock/bfi/bitcoin/transaction.hpp>
12#include <veriblock/pop/entities/btcblock.hpp>
28 std::move(previousBlock),
29 std::move(merkleRoot),
34 ADD_SERIALIZE_METHODS;
36 template <
typename Stream,
typename Operation>
37 inline void SerializationOp(Stream& s, Operation ser_action) {
38 READWRITE(this->version);
39 READWRITE(this->previousBlock);
40 READWRITE(this->merkleRoot);
41 READWRITE(this->timestamp);
42 READWRITE(this->bits);
43 READWRITE(this->nonce);
48 std::vector<Transaction> vtx{};
52 Block(int32_t version,
59 std::move(previousBlock),
60 std::move(merkleRoot),
65 ADD_SERIALIZE_METHODS;
67 template <
typename Stream,
typename Operation>
68 inline void SerializationOp(Stream& s, Operation ser_action) {
73 friend bool operator==(
const Block& a,
const Block& b) {
76 return A == B && a.vtx == b.vtx;
79 friend bool operator!=(
const Block& a,
const Block& b) {
return !(a == b); }
83 std::vector<uint256> vHave;
87 BlockLocator(
const std::vector<uint256>& vHave) : vHave(vHave) {}
89 ADD_SERIALIZE_METHODS;
91 template <
typename Stream,
typename Operation>
92 inline void SerializationOp(Stream& s, Operation ser_action) {
93 int nVersion = s.getVersion();
99 return a.vHave == b.vHave;