mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-04-07 03:18:15 +02:00
move timestamp variable under condition
This commit is contained in:
parent
8fd148bbb5
commit
05e8f03d43
@ -28,8 +28,8 @@ func generateInvoice(r *Relay, pubkey string) (string, error) {
|
||||
"label": label,
|
||||
})
|
||||
result, _ := cln.Rpc(r.CLNRune, "listinvoices", string(jparams))
|
||||
timestamp := time.Now().Unix()
|
||||
if gjson.Get(result, "result.invoices.#").Int() == 1 {
|
||||
timestamp := time.Now().Unix()
|
||||
if (gjson.Get(result, "result.invoices.0.expires_at").Int() > timestamp) {
|
||||
return gjson.Get(result, "result.invoices.0.bolt11").String(), nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user