32 const NodeId recipient1{1};
34 ipv4Addr.s_addr = 0xa0b0c001;
35 const CService addr1{ipv4Addr, 1111};
51 BOOST_REQUIRE(tx1->GetHash() == tx2->GetHash());
52 BOOST_REQUIRE(tx1->GetWitnessHash() != tx2->GetWitnessHash());
56 const auto it{std::ranges::find(infos, tx->GetWitnessHash(), [](
const auto& info) { return info.tx->GetWitnessHash(); })};
57 BOOST_REQUIRE(it != infos.end());
60 const auto check_peer_counts{[&](
size_t tx1_peer_count,
size_t tx2_peer_count) {
67 check_peer_counts(0, 0);
69 const auto tx_for_recipient1{pb.
PickTxForSend(recipient1, addr1).value()};
70 BOOST_CHECK(tx_for_recipient1 == tx1 || tx_for_recipient1 == tx2);
73 const NodeId recipient2{2};
74 const CService addr2{ipv4Addr, 2222};
75 const auto tx_for_recipient2{pb.
PickTxForSend(recipient2, addr2).value()};
76 BOOST_CHECK(tx_for_recipient2 == tx1 || tx_for_recipient2 == tx2);
79 check_peer_counts(1, 1);
81 const NodeId nonexistent_recipient{0};
105 const auto& [tx, peers]{find_tx_info(infos, tx_for_recipient1)};
111 const auto& [tx, peers]{find_tx_info(infos, tx_for_recipient2)};
130 const CService addr_nonexistent{ipv4Addr, 3333};
std::optional< CTransactionRef > PickTxForSend(const NodeId &will_send_to_nodeid, const CService &will_send_to_address) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Pick the transaction with the fewest send attempts, and confirmations, and oldest send/confirm times.