16#include <boost/test/unit_test.hpp>
25 *(
vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
33 static const unsigned int nTxCounts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095};
35 for (
int i = 0; i < 12; i++) {
36 unsigned int nTx = nTxCounts[i];
40 for (
unsigned int j=0; j<nTx; j++) {
48 std::vector<uint256> vTxid(nTx,
uint256());
49 for (
unsigned int j=0; j<nTx; j++)
50 vTxid[j] = block.
vtx[j]->GetHash();
58 for (
int att = 1; att < 15; att++) {
60 std::vector<bool> vMatch(nTx,
false);
61 std::vector<uint256> vMatchTxid1;
62 for (
unsigned int j=0; j<nTx; j++) {
66 vMatchTxid1.push_back(vTxid[j]);
77 unsigned int n = std::min<unsigned int>(nTx, 1 + vMatchTxid1.size()*
nHeight);
85 std::vector<uint256> vMatchTxid2;
86 std::vector<unsigned int> vIndex;
97 for (
int j=0; j<4; j++) {
100 std::vector<uint256> vMatchTxid3;
110 std::vector<uint256> vTxid = {
118 std::vector<bool> vMatch = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
false};
121 std::vector<unsigned int> vIndex;
uint256 ArithToUint256(const arith_uint256 &a)
std::vector< CTransactionRef > vtx
Double ended buffer combining vector and stream-like interfaces.
Data structure that represents a partial merkle tree.
uint256 ExtractMatches(std::vector< uint256 > &vMatch, std::vector< unsigned int > &vnIndex)
extract the matching txid's represented by this partial merkle tree and their respective indices with...
std::vector< uint256 > vHash
txids and internal hashes
BOOST_AUTO_TEST_SUITE_END()
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(pmt_test1)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
static uint64_t InsecureRandRange(uint64_t range)
static uint64_t InsecureRandBits(int bits)
A mutable version of CTransaction.
static const int PROTOCOL_VERSION
network protocol versioning