diff --git a/.gitignore b/.gitignore index da385481..0e58d9f6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,10 @@ data/ .wallet_secret .wallet_password .admin_enroll +admin.enroll admin.npub app.nprofile .admin_connect +admin.connect debug.txt proto/autogenerated/debug.txt diff --git a/scripts/extract_nprofile.sh b/scripts/extract_nprofile.sh index 422105fb..81c01ba5 100644 --- a/scripts/extract_nprofile.sh +++ b/scripts/extract_nprofile.sh @@ -64,11 +64,11 @@ get_log_info() { log "Retrieving connection information..." - # Wait for either .admin_connect or app.nprofile to appear + # Wait for either admin.connect or app.nprofile to appear START_TIME=$(date +%s) while [ $(($(date +%s) - START_TIME)) -lt $MAX_WAIT_TIME ]; do - if [ -f "$DATA_DIR/.admin_connect" ]; then - admin_connect=$(cat "$DATA_DIR/.admin_connect") + if [ -f "$DATA_DIR/admin.connect" ]; then + admin_connect=$(cat "$DATA_DIR/admin.connect") # Check if the admin_connect string is complete (contains both nprofile and secret) if [[ $admin_connect == nprofile* ]] && [[ $admin_connect == *:* ]]; then log "An admin has not yet been enrolled." @@ -87,10 +87,10 @@ get_log_info() { sleep $WAIT_INTERVAL done - if [ ! -f "$DATA_DIR/.admin_connect" ] && [ ! -f "$DATA_DIR/app.nprofile" ]; then - log "Neither .admin_connect nor app.nprofile file found after waiting. Please check the service status." + if [ ! -f "$DATA_DIR/admin.connect" ] && [ ! -f "$DATA_DIR/app.nprofile" ]; then + log "Neither admin.connect nor app.nprofile file found after waiting. Please check the service status." exit 1 - elif [ -f "$DATA_DIR/.admin_connect" ] && ! [[ $(cat "$DATA_DIR/.admin_connect") == nprofile1* ]] && ! [[ $(cat "$DATA_DIR/.admin_connect") == *:* ]]; then + elif [ -f "$DATA_DIR/admin.connect" ] && ! [[ $(cat "$DATA_DIR/admin.connect") == nprofile1* ]] && ! [[ $(cat "$DATA_DIR/admin.connect") == *:* ]]; then log "Admin connect information is incomplete. Please check the service status." exit 1 fi diff --git a/scripts/install_lightning_pub.sh b/scripts/install_lightning_pub.sh index fd10ce04..132a29d2 100755 --- a/scripts/install_lightning_pub.sh +++ b/scripts/install_lightning_pub.sh @@ -41,7 +41,7 @@ install_lightning_pub() { # Merge if upgrade if [ $upgrade_status -eq 100 ]; then - rsync -a --quiet --exclude='*.sqlite' --exclude='.env' --exclude='logs' --exclude='node_modules' --exclude='.jwt_secret' --exclude='.wallet_secret' --exclude='admin.npub' --exclude='app.nprofile' --exclude='.admin_connect' --exclude='.admin_enroll' $USER_HOME/lightning_pub_temp/ $USER_HOME/lightning_pub/ + rsync -a --quiet --exclude='*.sqlite' --exclude='.env' --exclude='logs' --exclude='node_modules' --exclude='.jwt_secret' --exclude='.wallet_secret' --exclude='admin.npub' --exclude='app.nprofile' --exclude='admin.connect' --exclude='admin.enroll' $USER_HOME/lightning_pub_temp/ $USER_HOME/lightning_pub/ else mv $USER_HOME/lightning_pub_temp $USER_HOME/lightning_pub fi diff --git a/src/services/metrics/index.ts b/src/services/metrics/index.ts index be5690bf..307992f3 100644 --- a/src/services/metrics/index.ts +++ b/src/services/metrics/index.ts @@ -11,6 +11,7 @@ import HtlcTracker from './htlcTracker.js' import { MainSettings } from '../main/settings.js' import { getLogger } from '../helpers/logger.js' import { encodeTLV, usageMetricsToTlv } from '../helpers/tlv.js' +import { ChannelCloseSummary_ClosureType } from '../../../proto/lnd/lightning.js' export default class Handler { @@ -321,7 +322,7 @@ export default class Handler { externalBalance.push({ x: e.block_height, y: e.external_balance }) } }) - const closed = await Promise.all(closedChannels.map(async c => { + const closed = await Promise.all(closedChannels.filter(c => c.closeType !== ChannelCloseSummary_ClosureType.FUNDING_CANCELED).map(async c => { const tx = await this.lnd.GetTx(c.closingTxHash) return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) } }))