Merge branch 'master' into optional_donation
[p2pool.git] / p2pool / bitcoin / data.py
index fa36848..a4378fe 100644 (file)
@@ -105,12 +105,9 @@ class Type(object):
     
     def hash256(self, obj):
         return HashType().unpack(hashlib.sha256(hashlib.sha256(self.pack(obj)).digest()).digest())
-
-    ltc_scrypt = None
+    
     def scrypt(self, obj):
-        # dynamically import ltc_scrypt so you will only get an error on runtime
-        if (not self.ltc_scrypt):
-            self.ltc_scrypt = __import__('ltc_scrypt')
+        import ltc_scrypt
         return HashType().unpack(self.ltc_scrypt.getPoWHash(self.pack(obj)))
 
 class VarIntType(Type):
@@ -876,31 +873,3 @@ if __name__ == '__main__':
             for a in x[1]:
                 print str(a).rjust(10),
         print
-
-# network definitions
-
-class Mainnet(object):
-    BITCOIN_P2P_PREFIX = 'f9beb4d9'.decode('hex')
-    BITCOIN_P2P_PORT = 8333
-    BITCOIN_ADDRESS_VERSION = 0
-    BITCOIN_RPC_PORT = 8332
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
-        not (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
-    BITCOIN_SYMBOL = 'BTC'
-
-class Testnet(object):
-    BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
-    BITCOIN_P2P_PORT = 18333
-    BITCOIN_ADDRESS_VERSION = 111
-    BITCOIN_RPC_PORT = 8332
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
-        (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
-    BITCOIN_SYMBOL = 'tBTC'