Skip to content

Commit ca1fd75

Browse files
gmaxwelllaanwj
authored andcommitted
Make orphan parent fetching ask for witnesses.
In 0.13 orphan transactions began being treated as implicit INVs for their parents. But the resulting getdata were not getting the witness flag. This fixes issue bitcoin#9182 reported by chjj and roasbeef on IRC. Github-Pull: bitcoin#9188 Rebased-From: 5b0150a
1 parent b96a8f7 commit ca1fd75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5586,10 +5586,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
55865586
}
55875587
}
55885588
if (!fRejectedParents) {
5589+
uint32_t nFetchFlags = GetFetchFlags(pfrom, chainActive.Tip(), chainparams.GetConsensus());
55895590
BOOST_FOREACH(const CTxIn& txin, tx.vin) {
5590-
CInv inv(MSG_TX, txin.prevout.hash);
5591-
pfrom->AddInventoryKnown(inv);
5592-
if (!AlreadyHave(inv)) pfrom->AskFor(inv);
5591+
CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);
5592+
pfrom->AddInventoryKnown(_inv);
5593+
if (!AlreadyHave(_inv)) pfrom->AskFor(_inv);
55935594
}
55945595
AddOrphanTx(tx, pfrom->GetId());
55955596

0 commit comments

Comments
 (0)