| 673 | } |
| 674 | |
| 675 | std::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 | |
| 699 | bool BlockChainState::add_transaction(const Hash &tid, const Transaction &tx, const BinaryArray &binary_tx, |
| 700 | bool check_sigs, const std::string &source_address) { |
no test coverage detected