From 30ff7dd70b9e718102e810b2d01f924c6b63aa4d Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Sun, 19 Apr 2015 20:53:46 +0200
Subject: [PATCH] Fixing bug in network broadcast

---
 src/cutecoin/core/community.py   | 2 +-
 src/cutecoin/core/net/network.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cutecoin/core/community.py b/src/cutecoin/core/community.py
index 5325475d..5829f4fd 100644
--- a/src/cutecoin/core/community.py
+++ b/src/cutecoin/core/community.py
@@ -466,7 +466,7 @@ class Community(QObject):
         if not ok:
             raise value_error
 
-        if tries == len(self.nodes):
+        if tries == len(nodes):
             raise NoPeerAvailable(self.currency, len(nodes))
 
     def jsonify(self):
diff --git a/src/cutecoin/core/net/network.py b/src/cutecoin/core/net/network.py
index b33dd097..3154aa8b 100644
--- a/src/cutecoin/core/net/network.py
+++ b/src/cutecoin/core/net/network.py
@@ -241,7 +241,7 @@ class Network(Watcher):
         if node.state in (Node.ONLINE, Node.DESYNCED):
             node.check_sync(self.latest_block)
         logging.debug("{0} -> {1}".format(self.latest_block, self.latest_block))
-        if self._block_found != self.latest_block:
+        if self._block_found < self.latest_block:
             logging.debug("New block found : {0}".format(self.latest_block))
             self.new_block_mined.emit(self.latest_block)
 
-- 
GitLab