mirror of
https://github.com/bumi/lntip
synced 2025-07-18 05:26:45 +00:00
Formatting
This commit is contained in:
parent
5c8d604a20
commit
518a834066
@ -1,13 +1,13 @@
|
||||
package ln
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"context"
|
||||
"crypto/x509"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"crypto/x509"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
@ -46,7 +46,7 @@ type LNDclient struct {
|
||||
func (c LNDclient) AddInvoice(value int64, memo string) (Invoice, error) {
|
||||
result := Invoice{}
|
||||
|
||||
stdOutLogger.Printf("Adding invoice: memo=%s amount=%v ", memo, value)
|
||||
stdOutLogger.Printf("Adding invoice: memo=%s value=%v ", memo, value)
|
||||
invoice := lnrpc.Invoice{
|
||||
Memo: memo,
|
||||
Value: value,
|
||||
|
17
lnme.go
17
lnme.go
@ -2,7 +2,12 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/GeertJohan/go.rice"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/bumi/lnme/ln"
|
||||
"github.com/didip/tollbooth/v6"
|
||||
"github.com/didip/tollbooth/v6/limiter"
|
||||
@ -13,10 +18,6 @@ import (
|
||||
"github.com/knadh/koanf/providers/file"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Middleware for request limited to prevent too many requests
|
||||
@ -124,9 +125,9 @@ func main() {
|
||||
})
|
||||
|
||||
// Check invoice status
|
||||
e.GET("/v1/invoice/:invoiceId", func(c echo.Context) error {
|
||||
invoiceId := c.Param("invoiceId")
|
||||
invoice, err := lnClient.GetInvoice(invoiceId)
|
||||
e.GET("/v1/invoice/:paymentHash", func(c echo.Context) error {
|
||||
paymentHash := c.Param("paymentHash")
|
||||
invoice, err := lnClient.GetInvoice(paymentHash)
|
||||
|
||||
if err != nil {
|
||||
stdOutLogger.Printf("Error looking up invoice: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user