2
0
mirror of https://github.com/edouardparis/lntop synced 2024-11-16 00:12:44 +00:00

Merge pull request #24 from rkfg/segfault-fix

Fix segfault on network errors
This commit is contained in:
Edouard 2021-06-19 14:24:47 +02:00 committed by GitHub
commit 5a7213deef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ func withTickerInfo() tickerFunc {
if err != nil {
logger.Error("network info returned an error", logging.Error(err))
}
if old != nil {
if old != nil && info != nil {
if old.BlockHeight != info.BlockHeight {
sub <- events.New(events.BlockReceived)
}
@ -73,7 +73,7 @@ func withTickerChannelsBalance() tickerFunc {
if err != nil {
logger.Error("network channels balance returned an error", logging.Error(err))
}
if old != nil {
if old != nil && channelsBalance != nil {
if old.Balance != channelsBalance.Balance ||
old.PendingOpenBalance != channelsBalance.PendingOpenBalance {
sub <- events.New(events.ChannelBalanceUpdated)
@ -92,7 +92,7 @@ func withTickerWalletBalance() tickerFunc {
if err != nil {
logger.Error("network wallet balance returned an error", logging.Error(err))
}
if old != nil {
if old != nil && walletBalance != nil {
if old.TotalBalance != walletBalance.TotalBalance ||
old.ConfirmedBalance != walletBalance.ConfirmedBalance ||
old.UnconfirmedBalance != walletBalance.UnconfirmedBalance {