Closed matthewleon closed 3 years ago
Where does the documentation state that it's ok to pass a nil default net?
It doesn't. At least not explicitly. My reading of it suggested that defaultNet
would only be used in the case of addresses that don't encode the network:
// The bitcoin network the address is associated with is extracted if possible. // When the address does not encode the network, such as in the case of a raw // public key, the address will be associated with the passed defaultNet.
But that's pretty subjective, and possible lazy, reading on my part.
Commit 3ac1210 breaks
DecodeAddress
's handling ofnil
defaultNet
: it will panic. The documentation suggests thatDecodeAddress
shouldn't require adefaultNet
, and indeed in the case of most Bitcoin addresses, with some small adjustments, it can work without one.