Changeset View
Changeset View
Standalone View
Standalone View
src/merkleblock.h
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
* If the CBlock has 0 txs, it will hit an assertion. | * If the CBlock has 0 txs, it will hit an assertion. | ||||
*/ | */ | ||||
class CMerkleBlock { | class CMerkleBlock { | ||||
public: | public: | ||||
/** Public only for unit testing */ | /** Public only for unit testing */ | ||||
CBlockHeader header; | CBlockHeader header; | ||||
CPartialMerkleTree txn; | CPartialMerkleTree txn; | ||||
/** Public only for unit testing and relay testing (not relayed) */ | /** | ||||
* Public only for unit testing and relay testing (not relayed). | |||||
* | |||||
* Used only when a bloom filter is specified to allow | |||||
* testing the transactions which matched the bloom filter. | |||||
*/ | |||||
deadalnix: Restore. | |||||
std::vector<std::pair<size_t, uint256>> vMatchedTxn; | std::vector<std::pair<size_t, uint256>> vMatchedTxn; | ||||
/** | /** | ||||
* Create a Merkle proof according to a bloom filter. Note | * Create a Merkle proof according to a bloom filter. Note | ||||
* that this will call IsRelevantAndUpdate on the filter for each | * that this will call IsRelevantAndUpdate on the filter for each | ||||
* transaction, thus the filter will likely be modified. | * transaction, thus the filter will likely be modified. | ||||
*/ | */ | ||||
CMerkleBlock(const CBlock &block, CBloomFilter &filter); | CMerkleBlock(const CBlock &block, CBloomFilter &filter) | ||||
: CMerkleBlock(block, &filter, nullptr) {} | |||||
deadalnixUnsubmitted Not Done Inline ActionsWhy was this removed? deadalnix: Why was this removed? | |||||
nakihitoUnsubmitted Done Inline ActionsI was told that the changes made in D3371 made code ownership no longer an issue and that the changes to the constructor made the code both more difficult to read and harder to maintain. nakihito: I was told that the changes made in D3371 made code ownership no longer an issue and that the… | |||||
/** | /** | ||||
* Create a Merkle proof for a set of transactions. | * Create a Merkle proof for a set of transactions. | ||||
*/ | */ | ||||
CMerkleBlock(const CBlock &block, const std::set<TxId> &txids); | CMerkleBlock(const CBlock &block, const std::set<TxId> &txids) | ||||
: CMerkleBlock(block, nullptr, &txids) {} | |||||
deadalnixUnsubmitted Not Done Inline Actionsdito deadalnix: dito | |||||
CMerkleBlock() {} | CMerkleBlock() {} | ||||
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) { | ||||
READWRITE(header); | READWRITE(header); | ||||
READWRITE(txn); | READWRITE(txn); | ||||
} | } | ||||
private: | |||||
// Combined constructor to consolidate code | |||||
CMerkleBlock(const CBlock &block, CBloomFilter *filter, | |||||
const std::set<TxId> *txids); | |||||
deadalnixUnsubmitted Not Done Inline Actionsdito deadalnix: dito | |||||
}; | }; | ||||
#endif // BITCOIN_MERKLEBLOCK_H | #endif // BITCOIN_MERKLEBLOCK_H |
Restore.