diff --git a/snippets/go/communicating_fees.go b/snippets/go/communicating_fees.go index 0a49be1c..f9ca14cd 100644 --- a/snippets/go/communicating_fees.go +++ b/snippets/go/communicating_fees.go @@ -8,7 +8,7 @@ import ( func getFeeInfoBeforeInvoiceCreated() { // ANCHOR: get-fee-info-before-receiving-payment - if nodeInfo, err := sdk.NodeInfo(); err != nil { + if nodeInfo, err := sdk.NodeInfo(); err == nil { var inboundLiquiditySat = nodeInfo.InboundLiquidityMsats / 1_000 if openingFeeResponse, err := sdk.OpenChannelFee(breez_sdk.OpenChannelFeeRequest{}); err == nil { @@ -48,7 +48,7 @@ func getFeeInfoReceiveOnchain() { var minDepositSat = swapInfo.MinAllowedDeposit var maxDepositSat = swapInfo.MaxAllowedDeposit - if nodeInfo, err := sdk.NodeInfo(); err != nil { + if nodeInfo, err := sdk.NodeInfo(); err == nil { var inboundLiquiditySat = nodeInfo.InboundLiquidityMsats / 1_000 var swapOpeningFees = swapInfo.ChannelOpeningFees diff --git a/snippets/go/getting_started.go b/snippets/go/getting_started.go index 84b9816c..395ac9d4 100644 --- a/snippets/go/getting_started.go +++ b/snippets/go/getting_started.go @@ -63,7 +63,7 @@ func GettingStartedRestoreOnly(config breez_sdk.Config, seed []uint8) *breez_sdk func FetchBalance() { // ANCHOR: fetch-balance - if nodeInfo, err := sdk.NodeInfo(); err != nil { + if nodeInfo, err := sdk.NodeInfo(); err == nil { lnBalance := nodeInfo.ChannelsBalanceMsat onchainBalance := nodeInfo.OnchainBalanceMsat