Skip to content

Commit d0b1a26

Browse files
authored
Merge pull request #943 from openmina/fix/sync/ledger/root/stuck
Fix: not handling timeout and empty response for num accounts query
2 parents 858c2a9 + 4b14569 commit d0b1a26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

node/src/p2p/callbacks/p2p_callbacks_reducer.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ impl crate::State {
7373
return;
7474
};
7575

76+
dispatcher.push(
77+
TransitionFrontierSyncLedgerSnarkedAction::PeerQueryNumAccountsError {
78+
peer_id,
79+
rpc_id,
80+
error: PeerLedgerQueryError::Timeout,
81+
},
82+
);
7683
dispatcher.push(
7784
TransitionFrontierSyncLedgerSnarkedAction::PeerQueryAddressError {
7885
peer_id,
@@ -373,6 +380,13 @@ impl crate::State {
373380
) {
374381
match response.as_deref() {
375382
None => {
383+
dispatcher.push(
384+
TransitionFrontierSyncLedgerSnarkedAction::PeerQueryNumAccountsError {
385+
peer_id,
386+
rpc_id: id,
387+
error: PeerLedgerQueryError::DataUnavailable,
388+
},
389+
);
376390
dispatcher.push(
377391
TransitionFrontierSyncLedgerSnarkedAction::PeerQueryAddressError {
378392
peer_id,

0 commit comments

Comments
 (0)