std::unique_ptr<cryptonote::Blockchain> bc; \
const std::pair<uint8_t, uint64_t> hard_forks[3]; \
hard_forks, \
window, \
}; \
} opts; \
cryptonote::Blockchain *blockchain = bc.get(); \
{ \
fprintf(stderr, "Failed to init blockchain\n"); \
exit(1); \
}
bool init(BlockchainDB *db, const network_type nettype=MAINNET, bool offline=false, const cryptonote::test_options *test_options=NULL, difficulty_type fixed_difficulty=0, const GetCheckpointsCallback &get_checkpoints=nullptr, bool ignore_bsig=false, bool fallback_to_pow=false)
Initialize the Blockchain state.
Transaction pool, handles transactions which are not part of a block.
unsigned __int64 uint64_t
112#define PREFIX_WINDOW(hf_version,window) \
113 std::unique_ptr<cryptonote::Blockchain> bc; \
114 cryptonote::tx_memory_pool txpool(*bc); \
115 bc.reset(new cryptonote::Blockchain(txpool)); \
116 struct get_test_options { \
117 const std::pair<uint8_t, uint64_t> hard_forks[3]; \
118 const cryptonote::test_options test_options = { \
119 hard_forks, \
120 window, \
121 }; \
122 get_test_options(): hard_forks{std::make_pair(1, (uint64_t)0), std::make_pair((uint8_t)hf_version, (uint64_t)LONG_TERM_BLOCK_WEIGHT_WINDOW), std::make_pair((uint8_t)0, (uint64_t)0)} {} \
123 } opts; \
124 cryptonote::Blockchain *blockchain = bc.get(); \
125 bool r = blockchain->init(new TestDB(), cryptonote::FAKECHAIN, true, &opts.test_options, 0, NULL); \
126 if (!r) \
127 { \
128 fprintf(stderr, "Failed to init blockchain\n"); \
129 exit(1); \
130 }