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);
87 template <
typename Stream,
typename Operation>
88 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
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);
149 template <
typename Stream,
typename Operation>
150 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
156 #endif // BITCOIN_MERKLEBLOCK_H
uint256 ExtractMatches(std::vector< uint256 > &vMatch)
unsigned int CalcTreeWidth(int height)
unsigned int nTransactions
std::vector< uint256 > vHash
void TraverseAndBuild(int height, unsigned int pos, const std::vector< uint256 > &vTxid, const std::vector< bool > &vMatch)
uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector< uint256 > &vMatch)
std::vector< bool > vBits
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
uint256 CalcHash(int height, unsigned int pos, const std::vector< uint256 > &vTxid)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::vector< std::pair< unsigned int, uint256 > > vMatchedTxn