File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
ironfish/src/rpc/routes/wallet Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ export async function useAccount(
14
14
return account
15
15
}
16
16
17
+ const status = await client . wallet . getAccountsStatus ( )
18
+ if ( status . content . locked ) {
19
+ throw new Error ( 'Wallet is locked. Unlock the wallet to fetch accounts' )
20
+ }
21
+
17
22
const defaultAccount = await client . wallet . getAccounts ( { default : true } )
18
23
19
24
if ( defaultAccount . content . accounts . length ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ import { serializeRpcWalletNote } from './serializers'
12
12
import { RpcWalletNote } from './types'
13
13
14
14
export function getAccount ( wallet : Wallet , name ?: string ) : Account {
15
+ if ( wallet . locked ) {
16
+ throw new RpcValidationError ( 'Wallet is locked. Unlock the wallet to fetch accounts' )
17
+ }
18
+
15
19
if ( name ) {
16
20
const account = wallet . getAccountByName ( name )
17
21
if ( account ) {
You can’t perform that action at this time.
0 commit comments