Add a CMerkleBlock to store merkle branches of filtered txes.
This commit is contained in:
30
src/main.h
30
src/main.h
@@ -2039,4 +2039,34 @@ struct CBlockTemplate
|
||||
std::vector<int64_t> vTxSigOps;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** Used to relay blocks as header + vector<merkle branch>
|
||||
* to filtered nodes.
|
||||
*/
|
||||
class CMerkleBlock
|
||||
{
|
||||
public:
|
||||
CBlockHeader header;
|
||||
|
||||
// We could optimize this a bit to deduplicate partial branches,
|
||||
// but it's not worth much unless a node has a ton of txes in a single block
|
||||
// tx index , tx hash, merkle branch
|
||||
std::vector<boost::tuple<unsigned int, uint256, std::vector<uint256> > > vtx;
|
||||
|
||||
// Create from a CBlock, filtering transactions according to filter
|
||||
// Note that this will call IsRelevantAndUpdate on the filter for each transaction,
|
||||
// thus the filter will likely be modified.
|
||||
CMerkleBlock(const CBlock& block, CBloomFilter& filter);
|
||||
|
||||
IMPLEMENT_SERIALIZE
|
||||
(
|
||||
READWRITE(header);
|
||||
READWRITE(vtx);
|
||||
)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user