mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix compilation errors
This commit is contained in:
parent
0280a288c6
commit
4704de76c6
5 changed files with 12 additions and 11 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include "td/utils/Time.h"
|
#include "td/utils/Time.h"
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
|
|
|
@ -472,7 +472,7 @@ td::Result<bool> Config::config_add_collator(ton::adnl::AdnlNodeIdShort addr, to
|
||||||
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
|
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
|
||||||
}
|
}
|
||||||
auto& shards = collators[addr];
|
auto& shards = collators[addr];
|
||||||
if (std::ranges::find(shards, shard) != collators[addr].end()) {
|
if (std::find(shards.begin(), shards.end(), shard) != shards.end()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
shards.push_back(shard);
|
shards.push_back(shard);
|
||||||
|
@ -484,7 +484,7 @@ td::Result<bool> Config::config_del_collator(ton::adnl::AdnlNodeIdShort addr, to
|
||||||
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
|
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
|
||||||
}
|
}
|
||||||
auto& shards = collators[addr];
|
auto& shards = collators[addr];
|
||||||
auto it = std::ranges::find(shards, shard);
|
auto it = std::find(shards.begin(), shards.end(), shard);
|
||||||
if (it == shards.end()) {
|
if (it == shards.end()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1605,7 +1605,7 @@ void ValidatorEngine::set_shard_check_function() {
|
||||||
shards.push_back(s);
|
shards.push_back(s);
|
||||||
}
|
}
|
||||||
std::sort(shards.begin(), shards.end());
|
std::sort(shards.begin(), shards.end());
|
||||||
shards.erase(std::ranges::unique(shards).begin(), shards.end());
|
shards.erase(std::unique(shards.begin(), shards.end()), shards.end());
|
||||||
validator_options_.write().set_shard_check_function(
|
validator_options_.write().set_shard_check_function(
|
||||||
[shards = std::move(shards)](ton::ShardIdFull shard) -> bool {
|
[shards = std::move(shards)](ton::ShardIdFull shard) -> bool {
|
||||||
for (auto s : shards) {
|
for (auto s : shards) {
|
||||||
|
|
|
@ -321,7 +321,7 @@ void CollationManager::alarm() {
|
||||||
if (collator.ping_at.is_in_past()) {
|
if (collator.ping_at.is_in_past()) {
|
||||||
collator.sent_ping = true;
|
collator.sent_ping = true;
|
||||||
td::BufferSlice query = create_serialize_tl_object<ton_api::collatorNode_ping>(0);
|
td::BufferSlice query = create_serialize_tl_object<ton_api::collatorNode_ping>(0);
|
||||||
td::Promise<td::BufferSlice> P = [=, SelfId = actor_id(this)](td::Result<td::BufferSlice> R) mutable {
|
td::Promise<td::BufferSlice> P = [=, id = id, SelfId = actor_id(this)](td::Result<td::BufferSlice> R) mutable {
|
||||||
td::actor::send_closure(SelfId, &CollationManager::got_pong, id, std::move(R));
|
td::actor::send_closure(SelfId, &CollationManager::got_pong, id, std::move(R));
|
||||||
};
|
};
|
||||||
LOG(DEBUG) << "sending ping to " << id;
|
LOG(DEBUG) << "sending ping to " << id;
|
||||||
|
|
|
@ -70,7 +70,7 @@ void CollatorNode::tear_down() {
|
||||||
|
|
||||||
void CollatorNode::add_shard(ShardIdFull shard) {
|
void CollatorNode::add_shard(ShardIdFull shard) {
|
||||||
CHECK(shard.is_valid_ext() && !shard.is_masterchain());
|
CHECK(shard.is_valid_ext() && !shard.is_masterchain());
|
||||||
if (std::ranges::find(collating_shards_, shard) != collating_shards_.end()) {
|
if (std::find(collating_shards_.begin(), collating_shards_.end(), shard) != collating_shards_.end()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(INFO) << "Collator node: local_id=" << local_id_ << " , shard=" << shard.to_str();
|
LOG(INFO) << "Collator node: local_id=" << local_id_ << " , shard=" << shard.to_str();
|
||||||
|
@ -78,7 +78,7 @@ void CollatorNode::add_shard(ShardIdFull shard) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollatorNode::del_shard(ShardIdFull shard) {
|
void CollatorNode::del_shard(ShardIdFull shard) {
|
||||||
auto it = std::ranges::find(collating_shards_, shard);
|
auto it = std::find(collating_shards_.begin(), collating_shards_.end(), shard);
|
||||||
if (it != collating_shards_.end()) {
|
if (it != collating_shards_.end()) {
|
||||||
collating_shards_.erase(it);
|
collating_shards_.erase(it);
|
||||||
}
|
}
|
||||||
|
@ -608,8 +608,8 @@ void CollatorNode::process_ping(adnl::AdnlNodeIdShort src, ton_api::collatorNode
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CollatorNode::can_collate_shard(ShardIdFull shard) const {
|
bool CollatorNode::can_collate_shard(ShardIdFull shard) const {
|
||||||
return std::ranges::any_of(collating_shards_,
|
return std::any_of(collating_shards_.begin(), collating_shards_.end(),
|
||||||
[&](const ShardIdFull& our_shard) { return shard_intersects(shard, our_shard); });
|
[&](const ShardIdFull& our_shard) { return shard_intersects(shard, our_shard); });
|
||||||
}
|
}
|
||||||
|
|
||||||
tl_object_ptr<ton_api::collatorNode_Candidate> CollatorNode::serialize_candidate(const BlockCandidate& block,
|
tl_object_ptr<ton_api::collatorNode_Candidate> CollatorNode::serialize_candidate(const BlockCandidate& block,
|
||||||
|
|
|
@ -936,9 +936,9 @@ bool FullNodeConfig::operator!=(const FullNodeConfig &rhs) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomOverlayParams::send_shard(const ShardIdFull &shard) const {
|
bool CustomOverlayParams::send_shard(const ShardIdFull &shard) const {
|
||||||
return sender_shards_.empty() || std::ranges::any_of(sender_shards_, [&](const ShardIdFull &our_shard) {
|
return sender_shards_.empty() ||
|
||||||
return shard_intersects(shard, our_shard);
|
std::any_of(sender_shards_.begin(), sender_shards_.end(),
|
||||||
});
|
[&](const ShardIdFull &our_shard) { return shard_intersects(shard, our_shard); });
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomOverlayParams CustomOverlayParams::fetch(const ton_api::engine_validator_customOverlay& f) {
|
CustomOverlayParams CustomOverlayParams::fetch(const ton_api::engine_validator_customOverlay& f) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue