@@ -117,8 +117,8 @@ namespace {
117117 int nSyncStarted GUARDED_BY (cs_main) = 0;
118118
119119 /* *
120- * Sources of received blocks, saved to be able to send them reject
121- * messages or ban them when processing happens afterwards.
120+ * Sources of received blocks, saved to be able punish them when processing
121+ * happens afterwards.
122122 * Set mapBlockSource[hash].second to false if the node should not be
123123 * punished if the block is invalid.
124124 */
@@ -2861,11 +2861,12 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
28612861 // been run). This is handled below, so just treat this as
28622862 // though the block was successfully read, and rely on the
28632863 // handling in ProcessNewBlock to ensure the block index is
2864- // updated, reject messages go out, etc.
2864+ // updated, etc.
28652865 MarkBlockAsReceived (resp.blockhash ); // it is now an empty pointer
28662866 fBlockRead = true ;
2867- // mapBlockSource is only used for sending reject messages and DoS scores,
2868- // so the race between here and cs_main in ProcessNewBlock is fine.
2867+ // mapBlockSource is used for potentially punishing peers and
2868+ // updating which peers send us compact blocks, so the race
2869+ // between here and cs_main in ProcessNewBlock is fine.
28692870 // BIP 152 permits peers to relay compact blocks after validating
28702871 // the header only; we should not punish peers if the block turns
28712872 // out to be invalid.
@@ -2937,8 +2938,9 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
29372938 // Also always process if we requested the block explicitly, as we may
29382939 // need it even though it is not a candidate for a new best tip.
29392940 forceProcessing |= MarkBlockAsReceived (hash);
2940- // mapBlockSource is only used for sending reject messages and DoS scores,
2941- // so the race between here and cs_main in ProcessNewBlock is fine.
2941+ // mapBlockSource is only used for punishing peers and setting
2942+ // which peers send us compact blocks, so the race between here and
2943+ // cs_main in ProcessNewBlock is fine.
29422944 mapBlockSource.emplace (hash, std::make_pair (pfrom->GetId (), true ));
29432945 }
29442946 bool fNewBlock = false ;
0 commit comments