Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
protocol: skip PoW work when target is zero
Open fintohaps opened 2 months ago
1 file changed +3 -0 15adb161 efc0cf4c
modified crates/radicle-protocol/src/service/message.rs
@@ -105,6 +105,9 @@ impl NodeAnnouncement {
    /// If the given difficulty target is too high, there may not be a result. In that case, `None`
    /// is returned.
    pub fn solve(mut self, target: u32) -> Option<Self> {
+
        if target == 0 {
+
            return Some(self);
+
        }
        loop {
            if let Some(nonce) = self.nonce.checked_add(1) {
                self.nonce = nonce;