本文整理汇总了C++中cryptonote::core::getPoolTransactions方法的典型用法代码示例。如果您正苦于以下问题:C++ core::getPoolTransactions方法的具体用法?C++ core::getPoolTransactions怎么用?C++ core::getPoolTransactions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cryptonote::core
的用法示例。
在下文中一共展示了core::getPoolTransactions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTransactionPublicKeyFromExtra
//-----------------------------------------------------------------------------------------------------
bool gen_chain_switch_1::check_split_not_switched(CryptoNote::core& c, size_t ev_index, const std::vector<test_event_entry>& events)
{
DEFINE_TESTS_ERROR_CONTEXT("gen_chain_switch_1::check_split_not_switched");
m_recipient_account_1 = boost::get<AccountBase>(events[1]);
m_recipient_account_2 = boost::get<AccountBase>(events[2]);
m_recipient_account_3 = boost::get<AccountBase>(events[3]);
m_recipient_account_4 = boost::get<AccountBase>(events[4]);
std::list<Block> blocks;
bool r = c.get_blocks(0, 10000, blocks);
CHECK_TEST_CONDITION(r);
CHECK_EQ(5 + 2 * m_currency.minedMoneyUnlockWindow(), blocks.size());
CHECK_TEST_CONDITION(blocks.back() == boost::get<Block>(events[20 + 2 * m_currency.minedMoneyUnlockWindow()])); // blk_4
CHECK_EQ(2, c.get_alternative_blocks_count());
std::vector<CryptoNote::Block> chain;
map_hash2tx_t mtx;
r = find_block_chain(events, chain, mtx, get_block_hash(blocks.back()));
CHECK_TEST_CONDITION(r);
CHECK_EQ(MK_COINS(8), get_balance(m_recipient_account_1, chain, mtx));
CHECK_EQ(MK_COINS(10), get_balance(m_recipient_account_2, chain, mtx));
CHECK_EQ(MK_COINS(14), get_balance(m_recipient_account_3, chain, mtx));
CHECK_EQ(MK_COINS(3), get_balance(m_recipient_account_4, chain, mtx));
std::vector<Transaction> tx_pool = c.getPoolTransactions();
CHECK_EQ(1, tx_pool.size());
std::vector<size_t> tx_outs;
uint64_t transfered;
lookup_acc_outs(m_recipient_account_4.getAccountKeys(), tx_pool.front(), getTransactionPublicKeyFromExtra(tx_pool.front().extra), tx_outs, transfered);
CHECK_EQ(MK_COINS(13), transfered);
m_chain_1.swap(blocks);
m_tx_pool.swap(tx_pool);
return true;
}