--pow: parallel work.

This commit is contained in:
fiatjaf
2024-08-20 23:06:14 -03:00
parent 0240866fa1
commit 014c6bc11d
3 changed files with 7 additions and 5 deletions

View File

@@ -269,8 +269,10 @@ example:
evt.PubKey, _ = nostr.GetPublicKey(sec)
}
// try to generate work with this difficulty -- essentially forever
nip13.Generate(&evt, int(difficulty), time.Hour*24*365)
// try to generate work with this difficulty -- runs forever
nonceTag, _ := nip13.DoWork(ctx, evt, int(difficulty))
evt.Tags = append(evt.Tags, nonceTag)
mustRehashAndResign = true
}