1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add overlay certificate checks

This commit is contained in:
OmicronTau 2021-11-13 16:17:17 +03:00 committed by EmelyanenkoK
parent 9e9351903a
commit 678a8a6a13
17 changed files with 232 additions and 62 deletions

View file

@ -54,7 +54,16 @@ td::Status OverlayFecBroadcastPart::check_duplicate() {
}
td::Status OverlayFecBroadcastPart::check_source() {
TRY_STATUS(overlay_->check_source_eligible(source_, cert_.get(), broadcast_size_));
auto r = overlay_->check_source_eligible(source_, cert_.get(), broadcast_size_, true);
if (r == BroadcastCheckResult::Forbidden) {
return td::Status::Error(ErrorCode::error, "broadcast is forbidden");
}
// FIXME
if (r == BroadcastCheckResult::NeedCheck) {
return td::Status::Error(ErrorCode::error, "broadcast is forbidden");
}
if (bcast_) {
TRY_STATUS(bcast_->is_eligible_sender(source_));
}