fix: amount

This commit is contained in:
2024-01-15 13:34:48 +00:00
parent 210c2f7cc4
commit 8911fca2fa

View File

@ -57,8 +57,8 @@ public class ReactionQueueWorker : BackgroundService
}
var amount = MapKindToAmount(ev.Kind);
if (amount != default)
{
if (amount == default) continue;
_logger.LogInformation("Got reaction {json}", NostrJson.Serialize(ev));
var eTag = ev.Tags?.FirstOrDefault(a => a.TagIdentifier == "e");
var pTag = ev.Tags?.FirstOrDefault(a => a.TagIdentifier == "p" && a.AdditionalData[0] == target);
@ -145,14 +145,14 @@ public class ReactionQueueWorker : BackgroundService
new NostrEventTag("e", ev.Id!),
new NostrEventTag("p", sender),
new NostrEventTag("relays", "wss://relay.snort.social", "wss://nos.lol", "wss://relay.damus.io"),
new NostrEventTag("amount", (amount * 1000).ToString()!)
new NostrEventTag("amount", (amount.Value * 1000).ToString())
)
};
var zapSigned = zap.Sign(key);
try
{
var invoice = await _lnurl.GetInvoiceAsync(svc, 5, "Thanks for your interaction!", zapSigned);
var invoice = await _lnurl.GetInvoiceAsync(svc, amount.Value, "Thanks for your interaction!", zapSigned);
if (string.IsNullOrEmpty(invoice.Pr))
{
_logger.LogInformation("blocked: failed to get invoice from {target}", parsedTarget);
@ -175,7 +175,6 @@ public class ReactionQueueWorker : BackgroundService
}
}
}
}
private int? MapKindToAmount(NostrKind k)