Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
| Show First 20 Lines • Show All 1,009 Lines • ▼ Show 20 Lines | void PeerLogicValidation::BlockChecked(const CBlock &block, | ||||
| const CValidationState &state) { | const CValidationState &state) { | ||||
| LOCK(cs_main); | LOCK(cs_main); | ||||
| const uint256 hash(block.GetHash()); | const uint256 hash(block.GetHash()); | ||||
| std::map<uint256, std::pair<NodeId, bool>>::iterator it = | std::map<uint256, std::pair<NodeId, bool>>::iterator it = | ||||
| mapBlockSource.find(hash); | mapBlockSource.find(hash); | ||||
| int nDoS = 0; | int nDoS = 0; | ||||
| if (state.IsInvalid(nDoS)) { | if (state.IsNotValid(nDoS)) { | ||||
| if (it != mapBlockSource.end() && State(it->second.first)) { | if (it != mapBlockSource.end() && State(it->second.first)) { | ||||
| // Blocks are never rejected with internal reject codes. | // Blocks are never rejected with internal reject codes. | ||||
| assert(state.GetRejectCode() < REJECT_INTERNAL); | assert(state.GetRejectCode() < REJECT_INTERNAL); | ||||
| CBlockReject reject = { | CBlockReject reject = { | ||||
| uint8_t(state.GetRejectCode()), | uint8_t(state.GetRejectCode()), | ||||
| state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), | state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), | ||||
| hash}; | hash}; | ||||
| State(it->second.first)->rejects.push_back(reject); | State(it->second.first)->rejects.push_back(reject); | ||||
| ▲ Show 20 Lines • Show All 2,821 Lines • Show Last 20 Lines | |||||