Skip to content

Commit

Permalink
fix: wrong sync status when using devnet (nervosnetwork#3183)
Browse files Browse the repository at this point in the history
* feat: mistake sync status

* fix: comment

---------

Co-authored-by: Chen Yu <keithwhisper@gmail.com>
  • Loading branch information
devchenyan and Keith-CY authored Jun 12, 2024
1 parent 77d99fb commit aa100d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/neuron-wallet/src/controllers/sync-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ export default class SyncApiController {
const rpcService = new RpcService(network.remote, network.type)
try {
const syncState = await rpcService.getSyncState()
const bestKnownBlockNumber =
network.chain === 'ckb_dev' ? await rpcService.getTipBlockNumber() : syncState.bestKnownBlockNumber
return {
bestKnownBlockNumber: parseInt(syncState.bestKnownBlockNumber, 16),
bestKnownBlockNumber: parseInt(bestKnownBlockNumber, 16),
bestKnownBlockTimestamp: +syncState.bestKnownBlockTimestamp,
}
} catch (error) {
Expand Down

0 comments on commit aa100d7

Please sign in to comment.