MCPcopy Create free account
hub / github.com/bcndev/bytecoin / sync_pool

Method sync_pool

src/Core/BlockChainState.cpp:675–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675std::vector<TransactionDesc> BlockChainState::sync_pool(
676 const std::pair<Amount, Hash> &from, const std::pair<Amount, Hash> &to, size_t max_count) const {
677 std::vector<TransactionDesc> result;
678 auto sit = m_memory_state_fee_tx.lower_bound(from);
679 if (sit != m_memory_state_fee_tx.end()) {
680 if (*sit != from)
681 ++sit;
682 }
683 while (sit != m_memory_state_fee_tx.begin()) {
684 --sit;
685 if (result.size() > max_count || *sit <= to)
686 break;
687 TransactionDesc desc;
688 desc.hash = sit->second;
689 auto tit = m_memory_state_tx.find(desc.hash);
690 invariant(tit != m_memory_state_tx.end(), "");
691 desc.fee = tit->second.fee;
692 desc.size = tit->second.binary_tx.size();
693 desc.newest_referenced_block = tit->second.newest_referenced_block;
694 result.push_back(desc);
695 }
696 return result;
697}
698
699bool BlockChainState::add_transaction(const Hash &tid, const Transaction &tx, const BinaryArray &binary_tx,
700 bool check_sigs, const std::string &source_address) {

Callers 1

Calls 3

endMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected