This commit is contained in:
boufni95 2025-01-14 15:51:29 +00:00
parent 1b63d27e40
commit 88ffb41f05
4 changed files with 11 additions and 8 deletions

2
.gitignore vendored
View file

@ -15,8 +15,10 @@ data/
.wallet_secret .wallet_secret
.wallet_password .wallet_password
.admin_enroll .admin_enroll
admin.enroll
admin.npub admin.npub
app.nprofile app.nprofile
.admin_connect .admin_connect
admin.connect
debug.txt debug.txt
proto/autogenerated/debug.txt proto/autogenerated/debug.txt

View file

@ -64,11 +64,11 @@ get_log_info() {
log "Retrieving connection information..." 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) START_TIME=$(date +%s)
while [ $(($(date +%s) - START_TIME)) -lt $MAX_WAIT_TIME ]; do while [ $(($(date +%s) - START_TIME)) -lt $MAX_WAIT_TIME ]; do
if [ -f "$DATA_DIR/.admin_connect" ]; then if [ -f "$DATA_DIR/admin.connect" ]; then
admin_connect=$(cat "$DATA_DIR/.admin_connect") admin_connect=$(cat "$DATA_DIR/admin.connect")
# Check if the admin_connect string is complete (contains both nprofile and secret) # Check if the admin_connect string is complete (contains both nprofile and secret)
if [[ $admin_connect == nprofile* ]] && [[ $admin_connect == *:* ]]; then if [[ $admin_connect == nprofile* ]] && [[ $admin_connect == *:* ]]; then
log "An admin has not yet been enrolled." log "An admin has not yet been enrolled."
@ -87,10 +87,10 @@ get_log_info() {
sleep $WAIT_INTERVAL sleep $WAIT_INTERVAL
done done
if [ ! -f "$DATA_DIR/.admin_connect" ] && [ ! -f "$DATA_DIR/app.nprofile" ]; then 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." log "Neither admin.connect nor app.nprofile file found after waiting. Please check the service status."
exit 1 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." log "Admin connect information is incomplete. Please check the service status."
exit 1 exit 1
fi fi

View file

@ -41,7 +41,7 @@ install_lightning_pub() {
# Merge if upgrade # Merge if upgrade
if [ $upgrade_status -eq 100 ]; then 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 else
mv $USER_HOME/lightning_pub_temp $USER_HOME/lightning_pub mv $USER_HOME/lightning_pub_temp $USER_HOME/lightning_pub
fi fi

View file

@ -11,6 +11,7 @@ import HtlcTracker from './htlcTracker.js'
import { MainSettings } from '../main/settings.js' import { MainSettings } from '../main/settings.js'
import { getLogger } from '../helpers/logger.js' import { getLogger } from '../helpers/logger.js'
import { encodeTLV, usageMetricsToTlv } from '../helpers/tlv.js' import { encodeTLV, usageMetricsToTlv } from '../helpers/tlv.js'
import { ChannelCloseSummary_ClosureType } from '../../../proto/lnd/lightning.js'
export default class Handler { export default class Handler {
@ -321,7 +322,7 @@ export default class Handler {
externalBalance.push({ x: e.block_height, y: e.external_balance }) 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) 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) } return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) }
})) }))