From 37a104729cb7195f0794a0c5a845719d28382f82 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 20 Jul 2022 15:05:14 -0300 Subject: [PATCH] adapt to new makeinvoice which fully supports updated CLN and commando. --- Makefile | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- makeinvoice.go | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index bd55cdf..0163ed9 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,6 @@ satdress: $(shell find . -name "*.go") $(shell find . -name "*.html") $(shell fi CC=$$(which musl-gcc) go build -ldflags='-s -w -linkmode external -extldflags "-static"' -o ./satdress deploy: satdress - ssh root@turgot 'systemctl stop bitmia tinytip payaddress paymentlink' + ssh root@turgot 'systemctl stop payaddress' scp satdress turgot:satdress/satdress - ssh root@turgot 'systemctl start bitmia tinytip payaddress paymentlink' + ssh root@turgot 'systemctl start payaddress' diff --git a/go.mod b/go.mod index 98cacf5..aa243c7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/cockroachdb/pebble v0.0.0-20210812144839-61318a019370 github.com/fiatjaf/go-lnurl v1.4.0 - github.com/fiatjaf/makeinvoice v1.4.0 + github.com/fiatjaf/makeinvoice v1.5.1 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/lib/pq v1.10.3 diff --git a/go.sum b/go.sum index 5ca65a6..eae124c 100644 --- a/go.sum +++ b/go.sum @@ -220,8 +220,8 @@ github.com/fiatjaf/lightningd-gjson-rpc v1.4.0 h1:Iv5tt4YuNoSMfR39wiV0tqnHYTJ85o github.com/fiatjaf/lightningd-gjson-rpc v1.4.0/go.mod h1:SQGA0qcY2qypaMXDQlE5V5+2MnLZzQ7NzfRsScliFeE= github.com/fiatjaf/ln-decodepay v1.0.0 h1:1YUMjvLock+BicMNwoZ/OA3oG2ZYEaJ8AzdS6EGVMTQ= github.com/fiatjaf/ln-decodepay v1.0.0/go.mod h1:/LWK+ZUa3i8MqbRjIMAiVQS2+NbhwKWlwib2n446cMQ= -github.com/fiatjaf/makeinvoice v1.4.0 h1:lXae4tbEYQvjepZDO84xb0Lo+EkUe+KAAwO89rJAlRM= -github.com/fiatjaf/makeinvoice v1.4.0/go.mod h1:ifTgHnXswV6LE21YBXKNAMC5g0wox6m1t1tT+O3dQiw= +github.com/fiatjaf/makeinvoice v1.5.1 h1:mVkIjm7dcvkwgAVJeCbk12F1BDtedHNN4qDKPRQJoYc= +github.com/fiatjaf/makeinvoice v1.5.1/go.mod h1:ifTgHnXswV6LE21YBXKNAMC5g0wox6m1t1tT+O3dQiw= github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= diff --git a/makeinvoice.go b/makeinvoice.go index 1575563..3e06e48 100644 --- a/makeinvoice.go +++ b/makeinvoice.go @@ -1,7 +1,6 @@ package main import ( - "crypto/sha256" "fmt" "strconv" "time" @@ -75,8 +74,8 @@ func makeInvoice( mip.Description = fmt.Sprintf("%s's PIN for '%s@%s' lightning address: %s", params.Domain, params.Name, params.Domain, *pin) } else { // make the lnurlpay description_hash - h := sha256.Sum256([]byte(makeMetadata(params))) - mip.DescriptionHash = h[:] + mip.Description = makeMetadata(params) + mip.UseDescriptionHash = true } // actually generate the invoice