Skip to content

Commit 28299ce

Browse files
committed
p2p: remove vestigial READ_STATUS_CHECKBLOCK_FAILED
1 parent bac9ee4 commit 28299ce

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

src/blockencodings.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ typedef enum ReadStatus_t
8484
READ_STATUS_OK,
8585
READ_STATUS_INVALID, // Invalid object, peer is sending bogus crap
8686
READ_STATUS_FAILED, // Failed to process object
87-
READ_STATUS_CHECKBLOCK_FAILED, // Used only by FillBlock to indicate a
88-
// failure in CheckBlock.
8987
} ReadStatus;
9088

9189
class CBlockHeaderAndShortTxIDs {

src/net_processing.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3381,23 +3381,7 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
33813381
return;
33823382
}
33833383
} else {
3384-
// Block is either okay, or possibly we received
3385-
// READ_STATUS_CHECKBLOCK_FAILED.
3386-
// Note that CheckBlock can only fail for one of a few reasons:
3387-
// 1. bad-proof-of-work (impossible here, because we've already
3388-
// accepted the header)
3389-
// 2. merkleroot doesn't match the transactions given (already
3390-
// caught in FillBlock with READ_STATUS_FAILED, so
3391-
// impossible here)
3392-
// 3. the block is otherwise invalid (eg invalid coinbase,
3393-
// block is too big, too many legacy sigops, etc).
3394-
// So if CheckBlock failed, #3 is the only possibility.
3395-
// Under BIP 152, we don't discourage the peer unless proof of work is
3396-
// invalid (we don't require all the stateless checks to have
3397-
// been run). This is handled below, so just treat this as
3398-
// though the block was successfully read, and rely on the
3399-
// handling in ProcessNewBlock to ensure the block index is
3400-
// updated, etc.
3384+
// Block is okay for further processing
34013385
RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId()); // it is now an empty pointer
34023386
fBlockRead = true;
34033387
// mapBlockSource is used for potentially punishing peers and

src/test/fuzz/partially_downloaded_block.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ FUZZ_TARGET(partially_downloaded_block, .init = initialize_pdb)
125125
assert(!fail_block_mutated);
126126
assert(block->GetHash() == reconstructed_block.GetHash());
127127
break;
128-
case READ_STATUS_CHECKBLOCK_FAILED: [[fallthrough]];
129128
case READ_STATUS_FAILED:
130129
assert(fail_block_mutated);
131130
break;

0 commit comments

Comments
 (0)