aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-10-10 11:28:22 -0400
committerJohn Newbery <john@johnnewbery.com>2019-10-10 13:31:57 -0400
commit04a2f326ec0f06fb4fce1c4f93500752f05dede8 (patch)
tree4c48477281c0fcf7e7aff2900b701835a44b4ba6 /src/net_processing.cpp
parente9d5a59e34ff2d538d8f5315efd9908bf24d0fdc (diff)
downloadbitcoin-04a2f326ec0f06fb4fce1c4f93500752f05dede8.tar.xz
[validation] Fix REJECT message comments
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 8d5cccc7ff..1425f091c5 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -117,8 +117,8 @@ namespace {
int nSyncStarted GUARDED_BY(cs_main) = 0;
/**
- * Sources of received blocks, saved to be able to send them reject
- * messages or ban them when processing happens afterwards.
+ * Sources of received blocks, saved to be able punish them when processing
+ * happens afterwards.
* Set mapBlockSource[hash].second to false if the node should not be
* punished if the block is invalid.
*/
@@ -2861,11 +2861,12 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// been run). This is handled below, so just treat this as
// though the block was successfully read, and rely on the
// handling in ProcessNewBlock to ensure the block index is
- // updated, reject messages go out, etc.
+ // updated, etc.
MarkBlockAsReceived(resp.blockhash); // it is now an empty pointer
fBlockRead = true;
- // mapBlockSource is only used for sending reject messages and DoS scores,
- // so the race between here and cs_main in ProcessNewBlock is fine.
+ // mapBlockSource is used for potentially punishing peers and
+ // updating which peers send us compact blocks, so the race
+ // between here and cs_main in ProcessNewBlock is fine.
// BIP 152 permits peers to relay compact blocks after validating
// the header only; we should not punish peers if the block turns
// out to be invalid.
@@ -2937,8 +2938,9 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// Also always process if we requested the block explicitly, as we may
// need it even though it is not a candidate for a new best tip.
forceProcessing |= MarkBlockAsReceived(hash);
- // mapBlockSource is only used for sending reject messages and DoS scores,
- // so the race between here and cs_main in ProcessNewBlock is fine.
+ // mapBlockSource is only used for punishing peers and setting
+ // which peers send us compact blocks, so the race between here and
+ // cs_main in ProcessNewBlock is fine.
mapBlockSource.emplace(hash, std::make_pair(pfrom->GetId(), true));
}
bool fNewBlock = false;