@@ -43,7 +43,7 @@ bool TxDownloadManager::AddTxAnnouncement(NodeId peer, const GenTxidVariant& gtx
43
43
{
44
44
return m_impl->AddTxAnnouncement (peer, gtxid, now);
45
45
}
46
- std::vector<GenTxid > TxDownloadManager::GetRequestsToSend (NodeId nodeid, std::chrono::microseconds current_time)
46
+ std::vector<GenTxidVariant > TxDownloadManager::GetRequestsToSend (NodeId nodeid, std::chrono::microseconds current_time)
47
47
{
48
48
return m_impl->GetRequestsToSend (nodeid, current_time);
49
49
}
@@ -218,7 +218,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxidVariant&
218
218
const bool overloaded = !info.m_relay_permissions && m_txrequest.CountInFlight (peer) >= MAX_PEER_TX_REQUEST_IN_FLIGHT;
219
219
if (overloaded) delay += OVERLOADED_PEER_TX_DELAY;
220
220
221
- m_txrequest.ReceivedInv (peer, GenTxid::FromVariant ( gtxid) , info.m_preferred , now + delay);
221
+ m_txrequest.ReceivedInv (peer, gtxid, info.m_preferred , now + delay);
222
222
223
223
return false ;
224
224
}
@@ -255,31 +255,31 @@ bool TxDownloadManagerImpl::MaybeAddOrphanResolutionCandidate(const std::vector<
255
255
// Treat finding orphan resolution candidate as equivalent to the peer announcing all missing parents.
256
256
// In the future, orphan resolution may include more explicit steps
257
257
for (const auto & parent_txid : unique_parents) {
258
- m_txrequest.ReceivedInv (nodeid, GenTxid::Txid ( parent_txid) , info.m_preferred , now + delay);
258
+ m_txrequest.ReceivedInv (nodeid, parent_txid, info.m_preferred , now + delay);
259
259
}
260
260
LogDebug (BCLog::TXPACKAGES, " added peer=%d as a candidate for resolving orphan %s\n " , nodeid, wtxid.ToString ());
261
261
return true ;
262
262
}
263
263
264
- std::vector<GenTxid > TxDownloadManagerImpl::GetRequestsToSend (NodeId nodeid, std::chrono::microseconds current_time)
264
+ std::vector<GenTxidVariant > TxDownloadManagerImpl::GetRequestsToSend (NodeId nodeid, std::chrono::microseconds current_time)
265
265
{
266
- std::vector<GenTxid > requests;
267
- std::vector<std::pair<NodeId, GenTxid >> expired;
266
+ std::vector<GenTxidVariant > requests;
267
+ std::vector<std::pair<NodeId, GenTxidVariant >> expired;
268
268
auto requestable = m_txrequest.GetRequestable (nodeid, current_time, &expired);
269
- for (const auto & entry : expired) {
270
- LogDebug (BCLog::NET, " timeout of inflight %s %s from peer=%d\n " , entry. second .IsWtxid () ? " wtx" : " tx" ,
271
- entry. second . GetHash ().ToString (), entry. first );
269
+ for (const auto & [expired_nodeid, gtxid] : expired) {
270
+ LogDebug (BCLog::NET, " timeout of inflight %s %s from peer=%d\n " , gtxid .IsWtxid () ? " wtx" : " tx" ,
271
+ gtxid. ToUint256 ().ToString (), expired_nodeid );
272
272
}
273
- for (const GenTxid & gtxid : requestable) {
274
- if (!AlreadyHaveTx (gtxid. ToVariant () , /* include_reconsiderable=*/ false )) {
273
+ for (const GenTxidVariant & gtxid : requestable) {
274
+ if (!AlreadyHaveTx (gtxid, /* include_reconsiderable=*/ false )) {
275
275
LogDebug (BCLog::NET, " Requesting %s %s peer=%d\n " , gtxid.IsWtxid () ? " wtx" : " tx" ,
276
- gtxid.GetHash ().ToString (), nodeid);
276
+ gtxid.ToUint256 ().ToString (), nodeid);
277
277
requests.emplace_back (gtxid);
278
- m_txrequest.RequestedTx (nodeid, gtxid.GetHash (), current_time + GETDATA_TX_INTERVAL);
278
+ m_txrequest.RequestedTx (nodeid, gtxid.ToUint256 (), current_time + GETDATA_TX_INTERVAL);
279
279
} else {
280
280
// We have already seen this transaction, no need to download. This is just a belt-and-suspenders, as
281
281
// this should already be called whenever a transaction becomes AlreadyHaveTx().
282
- m_txrequest.ForgetTxHash (gtxid.GetHash ());
282
+ m_txrequest.ForgetTxHash (gtxid.ToUint256 ());
283
283
}
284
284
}
285
285
return requests;
0 commit comments