Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115569
D8184.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D8184.diff
View Options
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -170,8 +170,8 @@
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 to punish them when processing
+ * happens afterwards.
* Set mapBlockSource[hash].second to false if the node should not be punished
* if the block is invalid.
*/
@@ -3396,16 +3396,17 @@
// 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.
// it is now an empty pointer
MarkBlockAsReceived(resp.blockhash);
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. 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.
+ // 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.
mapBlockSource.emplace(resp.blockhash,
std::make_pair(pfrom->GetId(), false));
}
@@ -3488,9 +3489,9 @@
// 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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:26 (8 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187598
Default Alt Text
D8184.diff (2 KB)
Attached To
D8184: [validation] Fix REJECT message comments
Event Timeline
Log In to Comment