fdbdcf1560
This change fixes a bug when an invoice is decoded for a network whose bech32 segwit prefix is longer than 2 characters. The length of the Bech32HRPSegwit network parameter is used to determine where in the human-readable portion of the invoice the amount begins, rather than assuming it begins after the first four characters. Decode() now throws an error when the encoded invoice does not match the active network. Changes the minimum hrp length check to >= 3 instead of >= 4. Also removes a redundant "if ...; err != nil check" that was raising a warning in invoice.go. |
||
---|---|---|
.. | ||
amountunits.go | ||
bech32.go | ||
invoice_internal_test.go | ||
invoice_test.go | ||
invoice.go | ||
README.md |
zpay32
The zpay32 package implements a basic scheme for the encoding of payment
requests between two lnd
nodes within the Lightning Network. The zpay32
encoding scheme uses the
zbase32
scheme along with a checksum to encode a serialized payment request.
The payment request serialized by the package consist of: the destination's public key, the payment hash to use for the payment, and the value of payment to send.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/zpay32