v0.2.0 (2018-07-29)
- Added: Interface
pay.StorageClient
- an abstraction for multiple storage clients, which allows you to write your own storage client for storing the preimages that have already been used as payment proof in a request (issue #1)- Methods
WasUsed(string) (bool, error)
andSetUsed(string) error
- Methods
- Added: Struct
pay.RedisClient
- implements theStorageClient
interface (issue #1)- Factory function
NewRedisClient(...)
- Factory function
- Added: Var
pay.DefaultRedisOptions
- aRedisOptions
object with default values - Added: Struct
pay.GoMap
- implements theStorageClient
interface (issue #1)- Factory function
NewGoMap()
- Factory function
- Improved: Increased middleware performance and decreased load on the connected lnd when invalid requests with the
x-preimage
header are received (invalid because the preimage was already used) - Instead of first getting a corresponding invoice for a preimage from the lnd and then checking if the preimage was used already, the order of these operations was switched, because then, if the preimage was already used, no request to lnd needs to be made anymore. - Improved: All fields of the struct
pay.RedisOptions
are now optional
Breaking changes
Package pay
:
- Changed:
pay.NewHandlerFuncMiddleware(...)
,pay.NewHandlerMiddleware(...)
andpay.NewGinMiddleware(...)
now take aln.StorageClient
instead of a*redis.Client
as parameter (issue #1)
Package ln
(none of these changes should affect anyone, because this package is meant to be used only internally):
- Changed:
ln.CheckPreimage(...)
was renamed toln.CheckInvoice(...)
and doesn't check the storage anymore. Theln
methods are supposed to just handle lightning related things and nothing else. - Removed: Package
lnrpc
- Instead of using our own generated lnd gRPC Go file, import the one from Lightning Labs.