You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Calculate map of txids -> positions and check mempool to see what we have (or dont)
77
79
// Because well-formed cmpctblock messages will have a (relatively) uniform distribution
@@ -103,11 +105,15 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
103
105
if (!have_txn[idit->second]) {
104
106
txn_available[idit->second] = it->GetSharedTx();
105
107
have_txn[idit->second] = true;
108
+
mempool_count++;
106
109
} else {
107
110
// If we find two mempool txn that match the short id, just request it.
108
111
// This should be rare enough that the extra bandwidth doesn't matter,
109
112
// but eating a round-trip due to FillBlock failure would be annoying
110
-
txn_available[idit->second].reset();
113
+
if (txn_available[idit->second]) {
114
+
txn_available[idit->second].reset();
115
+
mempool_count--;
116
+
}
111
117
}
112
118
}
113
119
// Though ideally we'd continue scanning for the two-txn-match-shortid case,
@@ -117,6 +123,8 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
117
123
break;
118
124
}
119
125
126
+
LogPrint("cmpctblock", "Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), cmpctblock.GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION));
0 commit comments