disable pow counting for now
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -52,7 +52,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible {
|
|||||||
var boosted_by: String?
|
var boosted_by: String?
|
||||||
|
|
||||||
// cached field for pow calc
|
// cached field for pow calc
|
||||||
var pow: Int?
|
//var pow: Int?
|
||||||
|
|
||||||
// custom flags for internal use
|
// custom flags for internal use
|
||||||
var flags: Int = 0
|
var flags: Int = 0
|
||||||
@@ -157,8 +157,8 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var description: String {
|
var description: String {
|
||||||
let p = pow.map { String($0) } ?? "?"
|
//let p = pow.map { String($0) } ?? "?"
|
||||||
return "NostrEvent { id: \(id) pubkey \(pubkey) kind \(kind) tags \(tags) pow \(p) content '\(content)' }"
|
return "NostrEvent { id: \(id) pubkey \(pubkey) kind \(kind) tags \(tags) content '\(content)' }"
|
||||||
}
|
}
|
||||||
|
|
||||||
var known_kind: NostrKind? {
|
var known_kind: NostrKind? {
|
||||||
@@ -280,7 +280,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible {
|
|||||||
|
|
||||||
func calculate_id() {
|
func calculate_id() {
|
||||||
self.id = calculate_event_id(ev: self)
|
self.id = calculate_event_id(ev: self)
|
||||||
self.pow = count_hash_leading_zero_bits(self.id)
|
//self.pow = count_hash_leading_zero_bits(self.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: timeout
|
// TODO: timeout
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ enum NostrResponse: Decodable {
|
|||||||
print(error)
|
print(error)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
ev.pow = count_hash_leading_zero_bits(ev.id)
|
//ev.pow = count_hash_leading_zero_bits(ev.id)
|
||||||
self = .event(sub_id, ev)
|
self = .event(sub_id, ev)
|
||||||
return
|
return
|
||||||
} else if typ == "NOTICE" {
|
} else if typ == "NOTICE" {
|
||||||
|
|||||||
Reference in New Issue
Block a user