/*
* This file is part of the Flowee project
* Copyright (C) 2009-2010 Satoshi Nakamoto
* Copyright (C) 2009-2015 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef FLOWEE_MERKLEBLOCK_H
#define FLOWEE_MERKLEBLOCK_H
#include
#include "primitives/MutableBlock.h"
#include "bloom.h"
/**
* Used to relay blocks as header + vector
* to filtered nodes.
*/
class CMerkleBlock
{
public:
/** Public only for unit testing */
BlockHeaderFields header;
CPartialMerkleTree txn;
public:
/** Public only for unit testing and relay testing (not relayed) */
std::vector > vMatchedTxn;
/**
* 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 MutableBlock& block, CBloomFilter& filter);
// Create from a CBlock, matching the txids in the set
CMerkleBlock(const MutableBlock& block, const std::set& txids);
CMerkleBlock() {}
ADD_SERIALIZE_METHODS
template
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(header);
READWRITE(txn);
}
};
#endif