Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3186,7 +3186,9 @@ static bool SendRejectsAndCheckIfBanned(CNode* pnode, CConnman* connman)
CNodeState &state = *State(pnode->GetId());

for (const CBlockReject& reject : state.rejects) {
connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, (std::string)NetMsgType::BLOCK, reject.chRejectCode, reject.strRejectReason, reject.hashBlock));
// Pass allowOptimisticSend=true here to allow sending the reject message immediately instead of waiting for the
// network thread to do it. This gives us a chance of actually sending out the reject before we close the connection.
connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, (std::string)NetMsgType::BLOCK, reject.chRejectCode, reject.strRejectReason, reject.hashBlock), true);
}
state.rejects.clear();

Expand Down
4 changes: 2 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3357,7 +3357,7 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c
// Size limits
unsigned int nMaxBlockSize = MaxBlockSize(fDIP0001Active_context);
if (block.vtx.empty() || block.vtx.size() > nMaxBlockSize || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > nMaxBlockSize)
return state.DoS(10, false, REJECT_INVALID, "bad-blk-length", false, "size limits failed");
return state.DoS(100, false, REJECT_INVALID, "bad-blk-length", false, "size limits failed");

// Check that all transactions are finalized and not over-sized
// Also count sigops
Expand All @@ -3374,7 +3374,7 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c

// Check sigops
if (nSigOps > MaxBlockSigOps(fDIP0001Active_context))
return state.DoS(10, false, REJECT_INVALID, "bad-blk-sigops", false, "out-of-bounds SigOpCount");
return state.DoS(100, false, REJECT_INVALID, "bad-blk-sigops", false, "out-of-bounds SigOpCount");

// Enforce rule that the coinbase starts with serialized block height
// After DIP3/DIP4 activation, we don't enforce the height in the input script anymore.
Expand Down
Loading