Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
protocol: skip PoW work when target is zero
Quaylyn Rimer committed 3 months ago
commit e25268eea2014236c2ab25163fa3ba9e0217ed9e
parent d2ab7b1b46935c95a46d0e7ddac3130b595eb15a
1 file changed +3 -0
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;