fix: never mine the inner kind-7 of gift-wrapped reactions

Reactions to NIP-17 groups and unsealed rumors are gift-wrapped: the
inner reaction only travels as ciphertext, so relays can never PoW-filter
it and mining it was pure battery waste. Account.reactTo now detects
private targets up front and routes them straight to the plain signer,
skipping the mining queue. DM/private-note/file wraps were already
correct (only the kind-1059 envelope is mined, never the seal or rumor).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADb3dez9jPk6QqyQ1rTx4V
This commit is contained in:
Claude
2026-07-10 21:43:00 +00:00
parent 6ef1caef77
commit ba98f8c232
@@ -898,7 +898,12 @@ class Account(
note: Note,
reaction: String,
) {
val powDifficulty = powDifficultyFor(ReactionEvent.KIND)
// Reactions to NIP-17 groups and unsealed rumors are gift-wrapped: the
// inner kind-7 only ever travels as ciphertext, so mining it is pure
// waste — those targets skip the queue and sign with the plain signer.
val isPrivateTarget = note.event is NIP17Group || note.isPrivateRumor()
val powDifficulty = if (isPrivateTarget) null else powDifficultyFor(ReactionEvent.KIND)
if (powDifficulty != null &&
mineInBackground(ReactionEvent.KIND, powDifficulty) { isActive ->
ReactionAction.reactTo(