mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
fix: reject kind:1059 gift wraps with empty content before caching
A gift wrap with an empty content string carries no NIP-44 ciphertext, so it can never be unwrapped. Filtering it at LocalCache's ingestion choke point (justConsumeInnerInner) rejects it before the Schnorr signature check and before it takes a permanent cache slot, and keeps GiftWrapEventHandler from retrying a doomed unwrap on every batch. Locally stripped wraps (copyNoContent, used to drop the ciphertext after a successful unwrap) are assigned directly to note.event and never pass through justConsume, so they are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011A6iSrJJHUoz686eDnCQMV
This commit is contained in:
@@ -3847,7 +3847,15 @@ object LocalCache : ILocalCache, ICacheProvider {
|
||||
}
|
||||
|
||||
is GiftWrapEvent -> {
|
||||
consumeRegularEvent(event, relay, wasVerified)
|
||||
// A wrap with an empty content carries no NIP-44 ciphertext and can
|
||||
// never be unwrapped — reject it before paying for a signature check
|
||||
// and a cache slot. Locally stripped copies (copyNoContent) are
|
||||
// assigned straight to note.event and never pass through here.
|
||||
if (event.content.isEmpty()) {
|
||||
false
|
||||
} else {
|
||||
consumeRegularEvent(event, relay, wasVerified)
|
||||
}
|
||||
}
|
||||
|
||||
is GroupEvent -> {
|
||||
|
||||
Reference in New Issue
Block a user