Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit be9c34c

Browse files
author
ton
committed
bugfixes
1 parent 8be3fc9 commit be9c34c

File tree

699 files changed

+1171
-978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

699 files changed

+1171
-978
lines changed

adnl/adnl-db.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-db.hpp"
2020
#include "td/db/RocksDb.h"

adnl/adnl-db.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-db.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-ext-client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-ext-client.hpp"
2020
#include "adnl-ext-client.h"

adnl/adnl-ext-client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-ext-client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-ext-connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-ext-connection.hpp"
2020

adnl/adnl-ext-connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-ext-server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-ext-server.hpp"
2020
#include "keys/encryptor.h"

adnl/adnl-ext-server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-ext-server.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl/adnl-message.h"
2020
#include "auto/tl/ton_api.hpp"

adnl/adnl-node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-node.h"
2020

adnl/adnl-node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-packet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-packet.h"
2020
#include "td/utils/Random.h"

adnl/adnl-query.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-query.h"
2020
#include "common/errorcode.h"

adnl/adnl-query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-static-nodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-static-nodes.h"
2020
#include "adnl-static-nodes.hpp"

adnl/adnl-static-nodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-static-nodes.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

adnl/adnl-test-loopback-implementation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "adnl-test-loopback-implementation.h"
2020

adnl/test/adnl-test-ping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
exception statement from your version. If you delete this exception statement
2424
from all source files in the program, then also delete it here.
2525
26-
Copyright 2017-2019 Telegram Systems LLP
26+
Copyright 2017-2020 Telegram Systems LLP
2727
*/
2828
#include "adnl/adnl-network-manager.h"
2929
#include "adnl/adnl-peer-table.h"

adnl/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "utils.hpp"
2020
#include "tl/tl_object_store.h"

adnl/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

blockchain-explorer/blockchain-explorer-query.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
exception statement from your version. If you delete this exception statement
2424
from all source files in the program, then also delete it here.
2525
26-
Copyright 2017-2019 Telegram Systems LLP
26+
Copyright 2017-2020 Telegram Systems LLP
2727
*/
2828
#pragma once
2929

catchain/catchain-block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include "catchain-block.hpp"
2020

catchain/catchain-block.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

catchain/catchain-received-block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#include <set>
2020

catchain/catchain-received-block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

catchain/catchain-received-block.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

catchain/catchain-receiver-interface.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ class CatChainReceiverInterface : public td::actor::Actor {
5555

5656
virtual void destroy() = 0;
5757

58-
static td::actor::ActorOwn<CatChainReceiverInterface> create(std::unique_ptr<Callback> callback, CatChainOptions opts,
59-
td::actor::ActorId<keyring::Keyring> keyring,
60-
td::actor::ActorId<adnl::Adnl> adnl,
61-
td::actor::ActorId<overlay::Overlays> overlay_manager,
62-
std::vector<CatChainNode> ids, PublicKeyHash local_id,
63-
CatChainSessionId unique_hash, std::string db_root,
64-
bool allow_unsafe_self_blocks_resync);
58+
static td::actor::ActorOwn<CatChainReceiverInterface> create(
59+
std::unique_ptr<Callback> callback, CatChainOptions opts, td::actor::ActorId<keyring::Keyring> keyring,
60+
td::actor::ActorId<adnl::Adnl> adnl, td::actor::ActorId<overlay::Overlays> overlay_manager,
61+
std::vector<CatChainNode> ids, PublicKeyHash local_id, CatChainSessionId unique_hash, std::string db_root,
62+
std::string db_suffix, bool allow_unsafe_self_blocks_resync);
6563

6664
virtual ~CatChainReceiverInterface() = default;
6765
};

catchain/catchain-receiver.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ CatChainReceiverImpl::CatChainReceiverImpl(std::unique_ptr<Callback> callback, C
430430
td::actor::ActorId<adnl::Adnl> adnl,
431431
td::actor::ActorId<overlay::Overlays> overlay_manager,
432432
std::vector<CatChainNode> ids, PublicKeyHash local_id,
433-
CatChainSessionId unique_hash, std::string db_root,
433+
CatChainSessionId unique_hash, std::string db_root, std::string db_suffix,
434434
bool allow_unsafe_self_blocks_resync)
435435
: callback_(std::move(callback))
436436
, opts_(std::move(opts))
@@ -439,6 +439,7 @@ CatChainReceiverImpl::CatChainReceiverImpl(std::unique_ptr<Callback> callback, C
439439
, overlay_manager_(overlay_manager)
440440
, local_id_(local_id)
441441
, db_root_(db_root)
442+
, db_suffix_(db_suffix)
442443
, allow_unsafe_self_blocks_resync_(allow_unsafe_self_blocks_resync) {
443444
std::vector<td::Bits256> short_ids;
444445
local_idx_ = static_cast<td::uint32>(ids.size());
@@ -491,7 +492,8 @@ void CatChainReceiverImpl::start_up() {
491492

492493
if (!opts_.debug_disable_db) {
493494
std::shared_ptr<td::KeyValue> kv = std::make_shared<td::RocksDb>(
494-
td::RocksDb::open(db_root_ + "/catchainreceiver-" + td::base64url_encode(as_slice(incarnation_))).move_as_ok());
495+
td::RocksDb::open(db_root_ + "/catchainreceiver" + db_suffix_ + td::base64url_encode(as_slice(incarnation_)))
496+
.move_as_ok());
495497
db_ = DbType{std::move(kv)};
496498

497499
auto P = td::PromiseCreator::lambda([SelfId = actor_id(this)](td::Result<DbType::GetResult> R) {
@@ -611,10 +613,10 @@ td::actor::ActorOwn<CatChainReceiverInterface> CatChainReceiverInterface::create
611613
std::unique_ptr<Callback> callback, CatChainOptions opts, td::actor::ActorId<keyring::Keyring> keyring,
612614
td::actor::ActorId<adnl::Adnl> adnl, td::actor::ActorId<overlay::Overlays> overlay_manager,
613615
std::vector<CatChainNode> ids, PublicKeyHash local_id, CatChainSessionId unique_hash, std::string db_root,
614-
bool allow_unsafe_self_blocks_resync) {
615-
auto A = td::actor::create_actor<CatChainReceiverImpl>("catchainreceiver", std::move(callback), std::move(opts),
616-
keyring, adnl, overlay_manager, std::move(ids), local_id,
617-
unique_hash, db_root, allow_unsafe_self_blocks_resync);
616+
std::string db_suffix, bool allow_unsafe_self_blocks_resync) {
617+
auto A = td::actor::create_actor<CatChainReceiverImpl>(
618+
"catchainreceiver", std::move(callback), std::move(opts), keyring, adnl, overlay_manager, std::move(ids),
619+
local_id, unique_hash, db_root, db_suffix, allow_unsafe_self_blocks_resync);
618620
return std::move(A);
619621
}
620622

@@ -1058,7 +1060,7 @@ static void destroy_db(std::string name, td::uint32 attempt) {
10581060
}
10591061

10601062
void CatChainReceiverImpl::destroy() {
1061-
auto name = db_root_ + "/catchainreceiver-" + td::base64url_encode(as_slice(incarnation_));
1063+
auto name = db_root_ + "/catchainreceiver" + db_suffix_ + td::base64url_encode(as_slice(incarnation_));
10621064
delay_action([name]() { destroy_db(name, 0); }, td::Timestamp::in(1.0));
10631065
stop();
10641066
}

catchain/catchain-receiver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

catchain/catchain-receiver.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ class CatChainReceiverImpl : public CatChainReceiver {
144144
CatChainReceiverImpl(std::unique_ptr<Callback> callback, CatChainOptions opts,
145145
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
146146
td::actor::ActorId<overlay::Overlays>, std::vector<CatChainNode> ids, PublicKeyHash local_id,
147-
CatChainBlockHash unique_hash, std::string db_root, bool allow_unsafe_self_blocks_resync);
147+
CatChainBlockHash unique_hash, std::string db_root, std::string db_suffix,
148+
bool allow_unsafe_self_blocks_resync);
148149

149150
private:
150151
std::unique_ptr<overlay::Overlays::Callback> make_callback() {
@@ -220,6 +221,7 @@ class CatChainReceiverImpl : public CatChainReceiver {
220221
td::Timestamp next_rotate_;
221222

222223
std::string db_root_;
224+
std::string db_suffix_;
223225

224226
using DbType = td::KeyValueAsync<CatChainBlockHash, td::BufferSlice>;
225227
DbType db_;

catchain/catchain-types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU Lesser General Public License
1515
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright 2017-2019 Telegram Systems LLP
17+
Copyright 2017-2020 Telegram Systems LLP
1818
*/
1919
#pragma once
2020

0 commit comments

Comments
 (0)