mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Cached checked certificates in overlays (#1338)
This commit is contained in:
parent
f00ff75548
commit
413da6cd20
4 changed files with 49 additions and 29 deletions
|
@ -466,6 +466,19 @@ class OverlayImpl : public Overlay {
|
|||
TrafficStats total_traffic_responses, total_traffic_responses_ctr;
|
||||
|
||||
OverlayOptions opts_;
|
||||
|
||||
struct CachedCertificate : td::ListNode {
|
||||
CachedCertificate(PublicKeyHash source, td::Bits256 cert_hash)
|
||||
: source(source)
|
||||
, cert_hash(cert_hash) {
|
||||
}
|
||||
|
||||
PublicKeyHash source;
|
||||
td::Bits256 cert_hash;
|
||||
};
|
||||
std::map<PublicKeyHash, std::unique_ptr<CachedCertificate>> checked_certificates_cache_;
|
||||
td::ListNode checked_certificates_cache_lru_;
|
||||
size_t max_checked_certificates_cache_size_ = 1000;
|
||||
};
|
||||
|
||||
} // namespace overlay
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue