Skip to content

Commit 917027f

Browse files
committed
Merge remote-tracking branch 'origin/release/1.0' into elmato/merge-remove-block-ack-request-main
2 parents 93a2ec7 + 7eee6dc commit 917027f

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/ship_receiver_plugin.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class ship_receiver_plugin_impl : std::enable_shared_from_this<ship_receiver_plu
118118
eosio::ship_protocol::request req = eosio::ship_protocol::get_blocks_request_v0{
119119
.start_block_num = start,
120120
.end_block_num = std::numeric_limits<uint32_t>::max(),
121-
.max_messages_in_flight = 4*1024,
121+
.max_messages_in_flight = std::numeric_limits<uint32_t>::max(),
122122
.have_positions = {},
123123
.irreversible_only = false,
124124
.fetch_block = true,
@@ -133,11 +133,6 @@ class ship_receiver_plugin_impl : std::enable_shared_from_this<ship_receiver_plu
133133
return send_request(req);
134134
}
135135

136-
auto send_get_blocks_ack_request(uint32_t num_messages) {
137-
eosio::ship_protocol::request req = eosio::ship_protocol::get_blocks_ack_request_v0{num_messages};
138-
return send_request(req);
139-
}
140-
141136
template <typename Buffer>
142137
eosio::ship_protocol::result get_result(Buffer&& b){
143138
auto data = b->data();
@@ -348,12 +343,10 @@ class ship_receiver_plugin_impl : std::enable_shared_from_this<ship_receiver_plu
348343
}
349344

350345
void start_read() {
351-
static size_t num_messages = 0;
352346
async_read([this](const auto ec, auto buff) {
353347
if (ec) {
354348
SILK_INFO << "Trying to recover from SHiP read failure.";
355349
// Reconnect and restart sync.
356-
num_messages = 0;
357350
reset_connection();
358351
return;
359352
}
@@ -371,16 +364,6 @@ class ship_receiver_plugin_impl : std::enable_shared_from_this<ship_receiver_plu
371364

372365
native_blocks_channel.publish(80, std::make_shared<channels::native_block>(std::move(*block)));
373366

374-
if(++num_messages % 1024 == 0) {
375-
//SILK_INFO << "Block #" << block->block_num;
376-
auto ec = send_get_blocks_ack_request(num_messages);
377-
if (ec) {
378-
num_messages = 0;
379-
reset_connection();
380-
return;
381-
}
382-
}
383-
384367
start_read();
385368
});
386369
}

0 commit comments

Comments
 (0)