lbryio / lbcd

An alternative full node implementation of LBRY's blockchain written in Go (golang)
https://lbry.com/
ISC License
39 stars 26 forks source link

error properly when lbcd fails to connect in HTTP POST mode #99

Closed lyoshenka closed 2 years ago

lyoshenka commented 2 years ago

in the case where you're e.g. trying to connect to an invalid address, the err vars in handleSendPostMessage() were being shadowed inside the for loop. if c.httpClient.Do() returned an error, that error never got returned upstream. then ioutil.ReadAll(httpResponse.Body) would get a nil pointer dereference.

this fixes that case.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3252072246


Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/infrastructure.go 0 4 0.0%
<!-- Total: 0 4 0.0% -->
Files with Coverage Reduction New Missed Lines %
integration/rpctest/blockgen.go 2 83.78%
btcec/signature.go 3 92.82%
peer/peer.go 9 75.92%
<!-- Total: 14 -->
Totals Coverage Status
Change from base Build 3200324786: -0.02%
Covered Lines: 22494
Relevant Lines: 44019

💛 - Coveralls