Skip to content

Commit a3477de

Browse files
authored
feat(ironfish): Return if the wallet is locked in getStatus (#5307)
1 parent 93908a9 commit a3477de

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ironfish/src/rpc/routes/node/getStatus.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ describe('Route node/getStatus', () => {
2525
blockSyncer: {
2626
status: 'stopped',
2727
},
28+
accounts: {
29+
locked: expect.any(Boolean),
30+
},
2831
})
2932
})
3033
})

ironfish/src/rpc/routes/node/getStatus.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export type GetNodeStatusResponse = {
9797
}
9898
accounts: {
9999
enabled: boolean
100+
locked: boolean
100101
scanning?: {
101102
hash: string
102103
sequence: number
@@ -236,6 +237,7 @@ export const GetStatusResponseSchema: yup.ObjectSchema<GetNodeStatusResponse> =
236237
})
237238
.defined(),
238239
enabled: yup.boolean().defined(),
240+
locked: yup.boolean().defined(),
239241
scanning: yup
240242
.object({
241243
hash: yup.string().defined(),
@@ -366,6 +368,7 @@ async function getStatus(node: FullNode): Promise<GetNodeStatusResponse> {
366368
},
367369
accounts: {
368370
enabled: node.config.get('enableWallet'),
371+
locked: node.wallet.locked,
369372
head: {
370373
hash: walletHead?.hash.toString('hex') ?? '',
371374
sequence: walletHead?.sequence ?? -1,

0 commit comments

Comments
 (0)