You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't error, but instead decoded just fine. It's explained in the godoc that the net is only used for legacy addresses. However, it looks like this is often overlooked. One example would be the instances of this in lnd found in this PR: lightningnetwork/lnd#6448
Would it be an idea to add a new method that decodes the address, and then verifies it is for the given network? Names could for example be DecodeAddressVerify, or DecodeAddressForNet.
The text was updated successfully, but these errors were encountered:
I like the idea of adding DecodeAddressForNet. Will review a PR. Would be nice to add a positive/negative unit test for both the existing and the new functions.
In its current form,
btcutil.DecodeAddress
has some slightly surprising behavior:This doesn't error, but instead decoded just fine. It's explained in the godoc that the net is only used for legacy addresses. However, it looks like this is often overlooked. One example would be the instances of this in
lnd
found in this PR: lightningnetwork/lnd#6448Would it be an idea to add a new method that decodes the address, and then verifies it is for the given network? Names could for example be
DecodeAddressVerify
, orDecodeAddressForNet
.The text was updated successfully, but these errors were encountered: