mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
zpay32: improve "wrong network" error message
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
938d367232
commit
c6499f095a
@@ -290,7 +290,8 @@ func Decode(invoice string, net *chaincfg.Params) (*Invoice, error) {
|
|||||||
// The next characters should be a valid prefix for a segwit BIP173
|
// The next characters should be a valid prefix for a segwit BIP173
|
||||||
// address that match the active network.
|
// address that match the active network.
|
||||||
if !strings.HasPrefix(hrp[2:], net.Bech32HRPSegwit) {
|
if !strings.HasPrefix(hrp[2:], net.Bech32HRPSegwit) {
|
||||||
return nil, fmt.Errorf("unknown network")
|
return nil, fmt.Errorf(
|
||||||
|
"invoice not for current active network '%s'", net.Name)
|
||||||
}
|
}
|
||||||
decodedInvoice.Net = net
|
decodedInvoice.Net = net
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user