Skip to content

Commit 83e3c7b

Browse files
committed
fix(API): use strict equality for syncMode in full-node diagnostics
The syncMode ternary used a truthy check for state.sync?.synced while the synced field on the same line used === true. A non-boolean truthy value (e.g. 1) would produce synced: false alongside syncMode: 'synced'.
1 parent 5275d27 commit 83e3c7b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/datalayer/fullNodeRpc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const getBlockchainState = async (options = {}) => {
8686
synced: state.sync?.synced === true,
8787
syncing: state.sync?.sync_mode === true,
8888
peakHeight: state.peak?.height ?? null,
89-
syncMode: state.sync?.sync_mode === true ? 'syncing' : state.sync?.synced ? 'synced' : 'not_synced',
89+
syncMode: state.sync?.sync_mode === true ? 'syncing' : state.sync?.synced === true ? 'synced' : 'not_synced',
9090
genesisChallengeInitialized: state.genesis_challenge_initialized ?? null,
9191
};
9292
} catch (error) {

0 commit comments

Comments
 (0)