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
✗ CI failure Quaylyn Rimer committed 2 months ago
commit efc0cf4cfd40956e3bfa79f0fd250a7313857619
parent 15adb161357262f9287d1b90fffda55f6c2611c0
1 failed (1 total) View logs
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;