fix nil pointer dereference if http error when getting btc address
This commit is contained in:
parent
5e401c06ae
commit
6ed332d8b6
@ -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
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user