nip11, nip13, nip46 changes from promenade port.

and verify pubkey validity when decoding it from an arbitrary json object.
This commit is contained in:
fiatjaf
2025-05-11 17:42:15 -03:00
parent f60fc08f8d
commit 4befaa0129
4 changed files with 27 additions and 35 deletions

View File

@@ -22,7 +22,7 @@ var (
//
// if the target is smaller than the actual difficulty then the value of the target is used.
// if the target is bigger than the actual difficulty then it returns 0.
func CommittedDifficulty(event *nostr.Event) int {
func CommittedDifficulty(event nostr.Event) int {
work := 0
if nonceTag := event.Tags.Find("nonce"); nonceTag != nil && len(nonceTag) >= 3 {
work = Difficulty(event.ID)