mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user