@@ -189,8 +189,10 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
189189 size_t tx_missing_offset = 0 ;
190190 for (size_t i = 0 ; i < txn_available.size (); i++) {
191191 if (!txn_available[i]) {
192- if (vtx_missing.size () <= tx_missing_offset)
192+ if (vtx_missing.size () <= tx_missing_offset) {
193+ LogPrint (BCLog::CMPCTBLOCK, " Transactions missing arg mismatches offset in loop: %zu %zu\n " , vtx_missing.size (), tx_missing_offset);
193194 return READ_STATUS_INVALID;
195+ }
194196 block.vtx [i] = vtx_missing[tx_missing_offset++];
195197 } else
196198 block.vtx [i] = std::move (txn_available[i]);
@@ -200,17 +202,23 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
200202 header.SetNull ();
201203 txn_available.clear ();
202204
203- if (vtx_missing.size () != tx_missing_offset)
205+ if (vtx_missing.size () != tx_missing_offset) {
206+ LogPrint (BCLog::CMPCTBLOCK, " Transactions missing arg mismatches offset: %zu %zu\n " , vtx_missing.size (), tx_missing_offset);
204207 return READ_STATUS_INVALID;
208+ }
205209
206210 CValidationState state;
207211 if (!CheckBlock (block, state, Params ().GetConsensus (), check_pow)) {
208212 // TODO: We really want to just check merkle tree manually here,
209213 // but that is expensive, and CheckBlock caches a block's
210214 // "checked-status" (in the CBlock?). CBlock should be able to
211215 // check its own merkle root and cache that check.
212- if (state.CorruptionPossible ())
216+ if (state.CorruptionPossible ()) {
217+ LogPrint (BCLog::CMPCTBLOCK, " Corrupted compact block? %s\n " , state.GetRejectReason ());
213218 return READ_STATUS_FAILED; // Possible Short ID collision
219+ }
220+
221+ LogPrint (BCLog::CMPCTBLOCK, " CheckBlock fail: %s\n " , state.GetRejectReason ());
214222 return READ_STATUS_CHECKBLOCK_FAILED;
215223 }
216224
0 commit comments