Skip to content

Commit

Permalink
fix: keysend request permission method and convert millisats to sats
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Dec 13, 2023
1 parent 0accfeb commit 453cdbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handle_pay_keysend_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (svc *Service) HandlePayKeysendEvent(ctx context.Context, request *Nip47Req
return nil, err
}

hasPermission, code, message := svc.hasPermission(&app, event, request.Method, 0)
hasPermission, code, message := svc.hasPermission(&app, event, NIP_47_PAY_INVOICE_METHOD, 0)
if hasPermission {
// We use pay_invoice permissions for budget and max amount
hasPermission, code, message = svc.hasPermission(&app, event, NIP_47_PAY_INVOICE_METHOD, payParams.Amount)
Expand Down Expand Up @@ -68,7 +68,7 @@ func (svc *Service) HandlePayKeysendEvent(ctx context.Context, request *Nip47Req
"senderPubkey": payParams.Pubkey,
}).Info("Sending payment")

preimage, err := svc.lnClient.SendKeysend(ctx, event.PubKey, payParams.Amount, payParams.Pubkey, payParams.Preimage, payParams.TLVRecords)
preimage, err := svc.lnClient.SendKeysend(ctx, event.PubKey, payParams.Amount/1000, payParams.Pubkey, payParams.Preimage, payParams.TLVRecords)
if err != nil {
svc.Logger.WithFields(logrus.Fields{
"eventId": event.ID,
Expand Down

0 comments on commit 453cdbb

Please sign in to comment.