Skip to content

Commit

Permalink
fix: The first sync only stuck full ckb node start.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanguoyu committed Mar 15, 2024
1 parent 2e7fa47 commit ec672d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/neuron-wallet/src/services/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class NodeService {
await stopMonitor('ckb')
const isDefaultCKBNeedStart = await this.isDefaultCKBNeedRestart()
if (isDefaultCKBNeedStart) {
if (SettingsService.getInstance().isFirstSync) {
const currentNetwork = NetworksService.getInstance().getCurrent()
if (SettingsService.getInstance().isFirstSync && currentNetwork.type === NetworkType.Default) {
logger.info("CKB:\tThis is the first sync, please wait for the user's confirmation")
return
}
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/tests/services/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe('NodeService', () => {
describe('test start default node', () => {
beforeEach(() => {
const NodeService = require('../../src/services/node').default
stubbedNetworsServiceGet.mockReturnValue({ remote: BUNDLED_CKB_URL, readonly: true })
stubbedNetworsServiceGet.mockReturnValue({ remote: BUNDLED_CKB_URL, readonly: true, type: 0 })
getLocalNodeInfoMock.mockRejectedValue('not start')
nodeService = new NodeService()
})
Expand Down

0 comments on commit ec672d7

Please sign in to comment.