mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix updateInit offset in storage (#1525)
This commit is contained in:
parent
61b9155d15
commit
1e8fdc0561
1 changed files with 4 additions and 4 deletions
|
@ -251,7 +251,7 @@ void PeerActor::loop_update_init() {
|
||||||
}
|
}
|
||||||
s = s.substr(peer_init_offset_, UPDATE_INIT_BLOCK_SIZE);
|
s = s.substr(peer_init_offset_, UPDATE_INIT_BLOCK_SIZE);
|
||||||
auto query = create_update_query(ton::create_tl_object<ton::ton_api::storage_updateInit>(
|
auto query = create_update_query(ton::create_tl_object<ton::ton_api::storage_updateInit>(
|
||||||
td::BufferSlice(s), (int)peer_init_offset_, to_ton_api(node_state)));
|
td::BufferSlice(s), (int)peer_init_offset_ * 8, to_ton_api(node_state)));
|
||||||
|
|
||||||
// take care about update_state_query initial state
|
// take care about update_state_query initial state
|
||||||
update_state_query_.state = node_state;
|
update_state_query_.state = node_state;
|
||||||
|
@ -502,11 +502,11 @@ void PeerActor::process_update_peer_parts(const tl_object_ptr<ton_api::storage_U
|
||||||
},
|
},
|
||||||
[&](const ton::ton_api::storage_updateState &state) {},
|
[&](const ton::ton_api::storage_updateState &state) {},
|
||||||
[&](const ton::ton_api::storage_updateInit &init) {
|
[&](const ton::ton_api::storage_updateInit &init) {
|
||||||
LOG(DEBUG) << "Processing updateInit query (offset=" << init.have_pieces_offset_ * 8 << ")";
|
LOG(DEBUG) << "Processing updateInit query (offset=" << init.have_pieces_offset_ << ")";
|
||||||
td::Bitset new_bitset;
|
td::Bitset new_bitset;
|
||||||
new_bitset.set_raw(init.have_pieces_.as_slice().str());
|
new_bitset.set_raw(init.have_pieces_.as_slice().str());
|
||||||
size_t offset = init.have_pieces_offset_ * 8;
|
size_t offset = init.have_pieces_offset_;
|
||||||
for (auto size = new_bitset.size(), i = size_t(0); i < size; i++) {
|
for (auto size = new_bitset.size(), i = (size_t)0; i < size; i++) {
|
||||||
if (new_bitset.get(i)) {
|
if (new_bitset.get(i)) {
|
||||||
add_piece(static_cast<PartId>(offset + i));
|
add_piece(static_cast<PartId>(offset + i));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue