Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Commit

Permalink
Moved network check to a list and added support for testnet3
Browse files Browse the repository at this point in the history
  • Loading branch information
jine committed Dec 13, 2012
1 parent 8e56ec5 commit f67f37f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion blkmond
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import sys, re, random, cStringIO, hashlib
MY_VERSION = 312
MY_SUBVERSION = ".4"

NETWORKS = [
"\xf9\xbe\xb4\xd9", # mainnet
"\xfa\xbf\xb5\xda", # testnet3
]

# Default Settings if no configuration file is given
settings = {
"host": "173.242.112.53",
Expand Down Expand Up @@ -735,7 +740,7 @@ class NodeConn(asyncore.dispatcher):
while True:
if len(self.recvbuf) < 4:
return
if self.recvbuf[:4] != "\xf9\xbe\xb4\xd9":
if self.recvbuf[:4] not in NETWORKS:
raise ValueError("got garbage %s" % repr(self.recvbuf))
if self.ver_recv < 209:
if len(self.recvbuf) < 4 + 12 + 4:
Expand Down

0 comments on commit f67f37f

Please sign in to comment.