55e693aa09
This commit fixes a panic that can result when a zpay32 payment request that is too short (and possibly invalid) is attempted to be decoded. To fix this bug, we now simply ensure that that after we decode the zbase32 encoding, the resulting set of bytes is _exactly_ the length we expect. A new error has been introduced to handle this case, and a simple test has been added which ensures proper handling of short payment requests. Fixes #127. |
||
---|---|---|
.. | ||
README.md | ||
zbase32check_test.go | ||
zbase32check.go |
zpay32
[] (https://travis-ci.org/lightningnetwork/lnd) [] (https://github.com/lightningnetwork/lnd/blob/master/LICENSE) [] (http://godoc.org/github.com/lightningnetwork/lnd/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