| 1885 | } |
| 1886 | |
| 1887 | std::vector<CTransactionRef> PeerManagerImpl::AbortPrivateBroadcast(const uint256& id) |
| 1888 | { |
| 1889 | const auto snapshot{m_tx_for_private_broadcast.GetBroadcastInfo()}; |
| 1890 | std::vector<CTransactionRef> removed_txs; |
| 1891 | |
| 1892 | size_t connections_cancelled{0}; |
| 1893 | for (const auto& tx_info : snapshot) { |
| 1894 | const CTransactionRef& tx{tx_info.tx}; |
| 1895 | if (tx->GetHash().ToUint256() != id && tx->GetWitnessHash().ToUint256() != id) continue; |
| 1896 | if (const auto peer_acks{m_tx_for_private_broadcast.Remove(tx)}) { |
| 1897 | removed_txs.push_back(tx); |
| 1898 | if (NUM_PRIVATE_BROADCAST_PER_TX > *peer_acks) { |
| 1899 | connections_cancelled += (NUM_PRIVATE_BROADCAST_PER_TX - *peer_acks); |
| 1900 | } |
| 1901 | } |
| 1902 | } |
| 1903 | m_connman.m_private_broadcast.NumToOpenSub(connections_cancelled); |
| 1904 | |
| 1905 | return removed_txs; |
| 1906 | } |
| 1907 | |
| 1908 | void PeerManagerImpl::AddToCompactExtraTransactions(const CTransactionRef& tx) |
| 1909 | { |
no test coverage detected