6 #ifndef BITCOIN_MERKLEBLOCK_H 7 #define BITCOIN_MERKLEBLOCK_H 71 uint256 CalcHash(
int height,
unsigned int pos,
const std::vector<uint256> &vTxid);
74 void TraverseAndBuild(
int height,
unsigned int pos,
const std::vector<uint256> &vTxid,
const std::vector<bool> &vMatch);
80 uint256 TraverseAndExtract(
int height,
unsigned int pos,
unsigned int &nBitsUsed,
unsigned int &nHashUsed, std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex);
87 template <
typename Stream,
typename Operation>
91 std::vector<unsigned char> vBytes;
92 if (ser_action.ForRead()) {
95 us.
vBits.resize(vBytes.size() * 8);
96 for (
unsigned int p = 0; p < us.
vBits.size(); p++)
97 us.
vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0;
100 vBytes.resize((
vBits.size()+7)/8);
101 for (
unsigned int p = 0; p <
vBits.size(); p++)
102 vBytes[p / 8] |=
vBits[p] << (p % 8);
108 CPartialMerkleTree(
const std::vector<uint256> &vTxid,
const std::vector<bool> &vMatch);
162 template <
typename Stream,
typename Operation>
173 #endif // BITCOIN_MERKLEBLOCK_H ADD_SERIALIZE_METHODS
Definition: merkleblock.h:85
unsigned int CalcTreeWidth(int height) const
Definition: merkleblock.h:66
CPartialMerkleTree txn
Definition: merkleblock.h:138
Definition: merkleblock.h:133
CMerkleBlock()
Definition: merkleblock.h:158
ADD_SERIALIZE_METHODS
Definition: merkleblock.h:160
CMerkleBlock(const CBlock &block, const std::set< uint256 > &txids)
Definition: merkleblock.h:156
uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector< uint256 > &vMatch, std::vector< unsigned int > &vnIndex)
Definition: merkleblock.cpp:77
Definition: merkleblock.h:50
CPartialMerkleTree()
Definition: merkleblock.cpp:129
CMerkleBlock(const CBlock &block, CBloomFilter &filter)
Definition: merkleblock.h:153
unsigned int nTransactions
Definition: merkleblock.h:54
std::vector< uint256 > vHash
Definition: merkleblock.h:60
void TraverseAndBuild(int height, unsigned int pos, const std::vector< uint256 > &vTxid, const std::vector< bool > &vMatch)
Definition: merkleblock.cpp:59
Definition: uint256.h:121
void SerializationOp(Stream &s, Operation ser_action)
Definition: merkleblock.h:163
std::vector< bool > vBits
Definition: merkleblock.h:57
CBlockHeader header
Definition: merkleblock.h:137
bool fBad
Definition: merkleblock.h:63
unsigned int GetNumTransactions() const
Definition: merkleblock.h:122
void SerializationOp(Stream &s, Operation ser_action)
Definition: merkleblock.h:88
uint256 ExtractMatches(std::vector< uint256 > &vMatch, std::vector< unsigned int > &vnIndex)
Definition: merkleblock.cpp:131
#define READWRITE(...)
Definition: serialize.h:184
uint256 CalcHash(int height, unsigned int pos, const std::vector< uint256 > &vTxid)
Definition: merkleblock.cpp:39
std::vector< std::pair< unsigned int, uint256 > > vMatchedTxn
Definition: merkleblock.h:146