Skip to content

Commit f32c408

Browse files
committed
Make sure unconfirmed parents are requestable
1 parent c4626bc commit f32c408

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/net_processing.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,17 @@ void static ProcessGetData(CNode& pfrom, const CChainParams& chainparams, CConnm
16941694
int nSendFlags = (inv.type == MSG_TX ? SERIALIZE_TRANSACTION_NO_WITNESS : 0);
16951695
connman->PushMessage(&pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *tx));
16961696
mempool.RemoveUnbroadcastTx(inv.hash);
1697+
// As we're going to send tx, make sure its unconfirmed parents are made requestable.
1698+
for (const auto& txin : tx->vin) {
1699+
auto txinfo = mempool.info(txin.prevout.hash);
1700+
if (txinfo.tx && txinfo.m_time > now - UNCONDITIONAL_RELAY_DELAY) {
1701+
// Relaying a transaction with a recent but unconfirmed parent.
1702+
if (WITH_LOCK(pfrom.m_tx_relay->cs_tx_inventory, return !pfrom.m_tx_relay->filterInventoryKnown.contains(txin.prevout.hash))) {
1703+
LOCK(cs_main);
1704+
State(pfrom.GetId())->m_recently_announced_invs.insert(txin.prevout.hash);
1705+
}
1706+
}
1707+
}
16971708
} else {
16981709
vNotFound.push_back(inv);
16991710
}

0 commit comments

Comments
 (0)