Changeset View
Changeset View
Standalone View
Standalone View
src/merkleblock.h
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | uint256 CalcHash(int height, unsigned int pos, | ||||
const std::vector<uint256> &vTxid); | const std::vector<uint256> &vTxid); | ||||
/** | /** | ||||
* Recursive function that traverses tree nodes, storing the data as bits | * Recursive function that traverses tree nodes, storing the data as bits | ||||
* and hashes. | * and hashes. | ||||
*/ | */ | ||||
void TraverseAndBuild(int height, unsigned int pos, | void TraverseAndBuild(int height, unsigned int pos, | ||||
const std::vector<uint256> &vTxid, | const std::vector<uint256> &vTxid, | ||||
const std::vector<bool> &vMatch); | const std::vector<bool> &vTxIdMask); | ||||
deadalnix: This is clearly not a mask of transaction ids. | |||||
/** | /** | ||||
* Recursive function that traverses tree nodes, consuming the bits and | * Recursive function that traverses tree nodes, consuming the bits and | ||||
* hashes produced by TraverseAndBuild. It returns the hash of the | * hashes produced by TraverseAndBuild. It returns the hash of the | ||||
* respective node and its respective index. | * respective node and its respective index. | ||||
*/ | */ | ||||
uint256 TraverseAndExtract(int height, unsigned int pos, | uint256 TraverseAndExtract(int height, unsigned int pos, | ||||
unsigned int &nBitsUsed, unsigned int &nHashUsed, | unsigned int &nBitsUsed, unsigned int &nHashUsed, | ||||
std::vector<uint256> &vMatch, | std::vector<uint256> &vMatchingTxHashes, | ||||
deadalnixUnsubmitted Not Done Inline ActionsAre these txhash or txid ? Or something plain hashes ? If these are TxId or TxHash, why is that a vector of uint256 then ? deadalnix: Are these txhash or txid ? Or something plain hashes ? If these are TxId or TxHash, why is that… | |||||
std::vector<unsigned int> &vnIndex); | std::vector<unsigned int> &vnIndex); | ||||
public: | public: | ||||
/** serialization implementation */ | /** serialization implementation */ | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
Show All 17 Lines | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Construct a partial merkle tree from a list of transaction ids, and a | * Construct a partial merkle tree from a list of transaction ids, and a | ||||
* mask that selects a subset of them. | * mask that selects a subset of them. | ||||
*/ | */ | ||||
CPartialMerkleTree(const std::vector<uint256> &vTxid, | CPartialMerkleTree(const std::vector<uint256> &vTxid, | ||||
const std::vector<bool> &vMatch); | const std::vector<bool> &vTxIdMask); | ||||
deadalnixUnsubmitted Not Done Inline Actionsdito deadalnix: dito | |||||
CPartialMerkleTree(); | CPartialMerkleTree(); | ||||
/** | /** | ||||
* Extract the matching txid's represented by this partial merkle tree and | * Extract the matching txid's represented by this partial merkle tree and | ||||
* their respective indices within the partial tree. Returns the merkle | * their respective indices within the partial tree. Returns the merkle | ||||
* root, or 0 in case of failure. | * root, or 0 in case of failure. | ||||
*/ | */ | ||||
uint256 ExtractMatches(std::vector<uint256> &vMatch, | uint256 ExtractMatches(std::vector<uint256> &vMatchingTxHashes, | ||||
deadalnixUnsubmitted Not Done Inline Actionsdito deadalnix: dito | |||||
std::vector<unsigned int> &vnIndex); | std::vector<unsigned int> &vnIndex); | ||||
}; | }; | ||||
/** | /** | ||||
* Used to create a Merkle proof (usually from a subset of transactions), | * Used to create a Merkle proof (usually from a subset of transactions), | ||||
* which consists of a block header and partial Merkle Tree. | * which consists of a block header and partial Merkle Tree. | ||||
* SPV clients typically use this Merkle proof to limit bandwidth and | * SPV clients typically use this Merkle proof to limit bandwidth and | ||||
* computation requirements to process incoming transactions. | * computation requirements to process incoming transactions. | ||||
Show All 37 Lines |
This is clearly not a mask of transaction ids.