Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #401 from hirishh/fix-handle-server-active-state
Browse files Browse the repository at this point in the history
fix(grpc): handle correctly SERVER_ACTIVE wallet state
  • Loading branch information
mrfelton authored Jan 11, 2022
2 parents df6b429 + cb79ee7 commit c8ae4c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class LndGrpc extends EventEmitter {
case 'UNLOCKED': // Do nothing.
break
case 'RPC_ACTIVE':
case 'SERVER_ACTIVE':
walletState = WALLET_STATE_ACTIVE
break
}
Expand Down Expand Up @@ -235,9 +236,9 @@ class LndGrpc extends EventEmitter {
async onBeforeActivateLightning() {
const { Lightning, WalletUnlocker } = this.services

// await for RPC_ACTIVE state before interacting if needed
// await for RPC_ACTIVE or SERVER_ACTIVE state before interacting if needed
if (this.isStateServiceAvailable) {
await this.checkWalletState('RPC_ACTIVE')
await this.checkWalletState(['RPC_ACTIVE', 'SERVER_ACTIVE'])
}

// Disconnect wallet unlocker if its connected.
Expand Down

0 comments on commit c8ae4c6

Please sign in to comment.