From c6499f095aa19f4507d4934b9609d7c4cb3720fa Mon Sep 17 00:00:00 2001 From: Sean Erle Johnson Date: Wed, 18 Apr 2018 12:37:28 -0700 Subject: [PATCH] zpay32: improve "wrong network" error message --- zpay32/invoice.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zpay32/invoice.go b/zpay32/invoice.go index 091ca30b9..fc9f7d81c 100644 --- a/zpay32/invoice.go +++ b/zpay32/invoice.go @@ -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 // address that match the active network. 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