Page MenuHomePhabricator

D8184.diff
No OneTemporary

D8184.diff

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

Mime Type
text/plain
Expires
Sat, Mar 1, 11:26 (6 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187598
Default Alt Text
D8184.diff (2 KB)

Event Timeline