Changeset View
Changeset View
Standalone View
Standalone View
src/test/txindex_tests.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | for (const auto &txn : m_coinbase_txns) { | ||||
} else if (tx_disk->GetId() != txn->GetId()) { | } else if (tx_disk->GetId() != txn->GetId()) { | ||||
BOOST_ERROR("Read incorrect tx"); | BOOST_ERROR("Read incorrect tx"); | ||||
} | } | ||||
} | } | ||||
// Check that new transactions in new blocks make it into the index. | // Check that new transactions in new blocks make it into the index. | ||||
for (int i = 0; i < 10; i++) { | for (int i = 0; i < 10; i++) { | ||||
CScript coinbase_script_pub_key = | CScript coinbase_script_pub_key = | ||||
GetScriptForDestination(coinbaseKey.GetPubKey().GetID()); | GetScriptForDestination(PKHash(coinbaseKey.GetPubKey())); | ||||
std::vector<CMutableTransaction> no_txns; | std::vector<CMutableTransaction> no_txns; | ||||
const CBlock &block = | const CBlock &block = | ||||
CreateAndProcessBlock(no_txns, coinbase_script_pub_key); | CreateAndProcessBlock(no_txns, coinbase_script_pub_key); | ||||
const CTransactionRef &txn = block.vtx[0]; | const CTransactionRef &txn = block.vtx[0]; | ||||
BOOST_CHECK(txindex.BlockUntilSyncedToCurrentChain()); | BOOST_CHECK(txindex.BlockUntilSyncedToCurrentChain()); | ||||
if (!txindex.FindTx(txn->GetId(), block_hash, tx_disk)) { | if (!txindex.FindTx(txn->GetId(), block_hash, tx_disk)) { | ||||
BOOST_ERROR("FindTx failed"); | BOOST_ERROR("FindTx failed"); | ||||
Show All 15 Lines |