Changeset View
Changeset View
Standalone View
Standalone View
src/test/pmt_tests.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | for (int i = 0; i < 12; i++) { | ||||
tx.nLockTime = j; | tx.nLockTime = j; | ||||
block.vtx.push_back(MakeTransactionRef(std::move(tx))); | block.vtx.push_back(MakeTransactionRef(std::move(tx))); | ||||
} | } | ||||
// calculate actual merkle root and height | // calculate actual merkle root and height | ||||
uint256 merkleRoot1 = BlockMerkleRoot(block); | uint256 merkleRoot1 = BlockMerkleRoot(block); | ||||
std::vector<uint256> vTxid(nTx, uint256()); | std::vector<uint256> vTxid(nTx, uint256()); | ||||
for (unsigned int j = 0; j < nTx; j++) | for (unsigned int j = 0; j < nTx; j++) | ||||
vTxid[j] = block.vtx[j]->GetId(); | vTxid[j] = block.vtx[j]->GetHash(); | ||||
int nHeight = 1, nTx_ = nTx; | int nHeight = 1, nTx_ = nTx; | ||||
while (nTx_ > 1) { | while (nTx_ > 1) { | ||||
nTx_ = (nTx_ + 1) / 2; | nTx_ = (nTx_ + 1) / 2; | ||||
nHeight++; | nHeight++; | ||||
} | } | ||||
// check with random subsets with inclusion chances 1, 1/2, 1/4, ..., | // check with random subsets with inclusion chances 1, 1/2, 1/4, ..., | ||||
// 1/128 | // 1/128 | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |