incremented network version to 901
[p2pool.git] / p2pool / p2p.py
index 84ebb00..6ccc46c 100644 (file)
@@ -45,7 +45,7 @@ class Protocol(p2protocol.Protocol):
         self.addr = self.transport.getPeer().host, self.transport.getPeer().port
         
         self.send_version(
-            version=8,
+            version=901,
             services=0,
             addr_to=dict(
                 services=0,
@@ -118,7 +118,7 @@ class Protocol(p2protocol.Protocol):
     def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
         if self.other_version is not None:
             raise PeerMisbehavingError('more than one version message')
-        if version < 4:
+        if version < 8:
             raise PeerMisbehavingError('peer too old')
         
         self.other_version = version
@@ -257,7 +257,7 @@ class Protocol(p2protocol.Protocol):
         ('shares', pack.ListType(p2pool_data.share_type)),
     ])
     def handle_shares(self, shares):
-        self.node.handle_shares([p2pool_data.load_share(share, self.node.net, self) for share in shares if share['type'] not in [6, 7]], self)
+        self.node.handle_shares([p2pool_data.load_share(share, self.node.net, self) for share in shares if share['type'] >= 9], self)
     
     def sendShares(self, shares, tracker, known_txs, include_txs_with=[]):
         if not shares:
@@ -267,7 +267,9 @@ class Protocol(p2protocol.Protocol):
             tx_hashes = set()
             for share in shares:
                 if share.hash in include_txs_with:
-                    tx_hashes.update(share.get_other_tx_hashes(tracker))
+                    x = share.get_other_tx_hashes(tracker)
+                    if x is not None:
+                        tx_hashes.update(x)
             
             hashes_to_send = [x for x in tx_hashes if x not in self.node.mining_txs_var.value and x in known_txs]
             
@@ -308,7 +310,7 @@ class Protocol(p2protocol.Protocol):
     ])
     def handle_sharereply(self, id, result, shares):
         if result == 'good':
-            res = [p2pool_data.load_share(share, self.node.net, self) for share in shares if share['type'] not in [6, 7]]
+            res = [p2pool_data.load_share(share, self.node.net, self) for share in shares if share['type'] >= 9]
         else:
             res = failure.Failure("sharereply result: " + result)
         self.get_shares.got_response(id, res)