From 24edf8bca5ddaf58895de26787373a1176b2016d Mon Sep 17 00:00:00 2001 From: devchenyan Date: Fri, 7 Jun 2024 20:47:02 +0800 Subject: [PATCH] fix: comment --- packages/neuron-wallet/src/controllers/sync-api.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/neuron-wallet/src/controllers/sync-api.ts b/packages/neuron-wallet/src/controllers/sync-api.ts index dae575252d..69b9603f76 100644 --- a/packages/neuron-wallet/src/controllers/sync-api.ts +++ b/packages/neuron-wallet/src/controllers/sync-api.ts @@ -108,12 +108,10 @@ export default class SyncApiController { const rpcService = new RpcService(network.remote, network.type) try { const syncState = await rpcService.getSyncState() - let bestKnownBlockNumber = parseInt(syncState.bestKnownBlockNumber, 16) - if (network.chain === 'ckb_dev') { - bestKnownBlockNumber = parseInt(await rpcService.getTipBlockNumber(), 16) - } + const bestKnownBlockNumber = + network.chain === 'ckb_dev' ? await rpcService.getTipBlockNumber() : syncState.bestKnownBlockNumber return { - bestKnownBlockNumber, + bestKnownBlockNumber: parseInt(bestKnownBlockNumber, 16), bestKnownBlockTimestamp: +syncState.bestKnownBlockTimestamp, } } catch (error) {