@ -376,9 +376,8 @@ fn commThreadLoop(self: *Daemon) void {
} ;
} ;
defer res . deinit ( ) ;
defer res . deinit ( ) ;
const msg = res . value ;
logger . debug ( " got msg: {s} " , . { @tagName ( res . value ) } ) ;
logger . debug ( " got msg: {s} " , . { @tagName ( msg ) } ) ;
switch ( res . value ) {
switch ( msg ) {
. pong = > {
. pong = > {
logger . info ( " received pong from ngui " , . { } ) ;
logger . info ( " received pong from ngui " , . { } ) ;
} ,
} ,
@ -408,7 +407,7 @@ fn commThreadLoop(self: *Daemon) void {
/ / TODO : send err back to ngui
/ / TODO : send err back to ngui
} ;
} ;
} ,
} ,
else = > logger . warn ( " unhandled msg tag {s} " , . { @tagName ( msg ) } ) ,
else = > | v | logger . warn ( " unhandled msg tag {s} " , . { @tagName ( v ) } ) ,
}
}
self . mu . lock ( ) ;
self . mu . lock ( ) ;
@ -579,7 +578,7 @@ fn sendBitcoindReport(self: *Daemon) !void {
const mempool = try client . call ( . getmempoolinfo , { } ) ;
const mempool = try client . call ( . getmempoolinfo , { } ) ;
defer mempool . deinit ( ) ;
defer mempool . deinit ( ) ;
const balance : ? lndhttp . WalletBalance = blk : {
const balance : ? lndhttp . Client. Result ( . walletbalance ) = blk : { / / lndhttp . WalletBalance
var lndc = lndhttp . Client . init ( . {
var lndc = lndhttp . Client . init ( . {
. allocator = self . allocator ,
. allocator = self . allocator ,
. tlscert_path = " /home/lnd/.lnd/tls.cert " ,
. tlscert_path = " /home/lnd/.lnd/tls.cert " ,
@ -587,9 +586,9 @@ fn sendBitcoindReport(self: *Daemon) !void {
} ) catch break : blk null ;
} ) catch break : blk null ;
defer lndc . deinit ( ) ;
defer lndc . deinit ( ) ;
const res = lndc . call ( . walletbalance , { } ) catch break : blk null ;
const res = lndc . call ( . walletbalance , { } ) catch break : blk null ;
defer res . deinit ( ) ;
break : blk res ;
break : blk res . value ;
} ;
} ;
defer if ( balance ) | bal | bal . deinit ( ) ;
const btcrep : comm . Message . BitcoinReport = . {
const btcrep : comm . Message . BitcoinReport = . {
. blocks = bcinfo . value . blocks ,
. blocks = bcinfo . value . blocks ,
@ -617,11 +616,11 @@ fn sendBitcoindReport(self: *Daemon) !void {
} ,
} ,
. balance = if ( balance ) | bal | . {
. balance = if ( balance ) | bal | . {
. source = . lnd ,
. source = . lnd ,
. total = bal . total_balance,
. total = bal . value. total_balance,
. confirmed = bal . confirmed_balance,
. confirmed = bal . value. confirmed_balance,
. unconfirmed = bal . unconfirmed_balance,
. unconfirmed = bal . value. unconfirmed_balance,
. locked = bal . locked_balance,
. locked = bal . value. locked_balance,
. reserved = bal . reserved_balance_anchor_chan,
. reserved = bal . value. reserved_balance_anchor_chan,
} else null ,
} else null ,
} ;
} ;