lnlink

iOS app for connecting to lightning nodes
git clone git://jb55.com/lnlink
Log | Files | Refs | Submodules | README | LICENSE

commit e3c1f4a45e29c0aeec2984b2d1de3237e0b8e5fc
parent f2e484e812eea4d8e8b373d23565bfb7fda666c7
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 27 Mar 2022 08:00:31 -0700

fix some lnurls

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mlightninglink/LNUrl.swift | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lightninglink/LNUrl.swift b/lightninglink/LNUrl.swift @@ -114,7 +114,8 @@ func decode_data<T: Decodable>(_ data: Data) -> T? { } func lnurl_fetchinvoice(lnurlp: LNUrlPay, amount: Int64, completion: @escaping (Either<LNUrlError, LNUrlPayInvoice>) -> ()) { - guard let url = URL(string: lnurlp.callback.absoluteString + "?amount=\(amount)") else { + let c = lnurlp.callback.absoluteString.contains("?") ? "&" : "?" + guard let url = URL(string: lnurlp.callback.absoluteString + "\(c)amount=\(amount)") else { completion(.left(LNUrlError(reason: "Invalid lnurl callback"))) return }