fix nil pointer dereference if http error when getting btc address
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Steven Polley 2024-09-23 08:59:42 -06:00
parent 5e401c06ae
commit 6ed332d8b6

View File

@ -56,6 +56,7 @@ func (p *Provider) GetBalances() ([]int, []string, error) {
addressResponse, err := p.client.getAddress(bitcoinAddress) addressResponse, err := p.client.getAddress(bitcoinAddress)
if err != nil { if err != nil {
log.Printf("failed to get bitcoin address '%s': %v", bitcoinAddress, err) log.Printf("failed to get bitcoin address '%s': %v", bitcoinAddress, err)
return
} }
satoshiBalance += addressResponse.ChainStats.FundedTxoSum - addressResponse.ChainStats.SpentTxoSum satoshiBalance += addressResponse.ChainStats.FundedTxoSum - addressResponse.ChainStats.SpentTxoSum
}() }()