Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(lnd): update log parsing to detect neutrino wallet state
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton authored and rahulbile committed Aug 15, 2021
1 parent ebff95f commit 1e506a3
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions services/neutrino/neutrino.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ class Neutrino extends EventEmitter {
stdout.pipe(split2()).on('data', line => {
this.handleErrors(line)
this.notifyOnWalletUnlockerActivation(line)
this.notifyLightningActivation(line)

// If the sync has already completed then we don't need to do any more log processing.
if (this.is(NEUTRINO_CHAIN_SYNC_COMPLETE)) {
Expand Down Expand Up @@ -487,26 +486,13 @@ class Neutrino extends EventEmitter {
* @param {string} line log output line
*/
notifyOnWalletUnlockerActivation(line) {
if (line.includes('RPC server listening on') && line.toLowerCase().includes('password')) {
if (line.includes('Waiting for wallet encryption password')) {
this.isWalletUnlockerGrpcActive = true
this.isLightningGrpcActive = false
this.emit(NEUTRINO_WALLET_UNLOCKER_GRPC_ACTIVE)
}
}

/**
* notifyLightningActivation - Update state if log line indicates Lightning gRPC became active.
*
* @param {string} line log output line
*/
notifyLightningActivation(line) {
if (line.includes('RPC server listening on') && !line.toLowerCase().includes('password')) {
this.isLightningGrpcActive = true
this.isWalletUnlockerGrpcActive = false
this.emit(NEUTRINO_LIGHTNING_GRPC_ACTIVE)
}
}

/**
* notifyOnSyncWaiting - Update state if log line indicates we are waiting to sync.
*
Expand Down

0 comments on commit 1e506a3

Please sign in to comment.