diff --git a/lib/blockchain.py b/lib/blockchain.py index fe599fb5..679270af 100644 --- a/lib/blockchain.py +++ b/lib/blockchain.py @@ -383,7 +383,8 @@ class Blockchain(util.PrintError): def bits_to_target(self, bits): bitsN = (bits >> 24) & 0xff if not (bitsN >= 0x03 and bitsN <= 0x1f): - raise Exception("First part of bits should be in [0x03, 0x1f]") + if not constants.net.TESTNET: + raise Exception("First part of bits should be in [0x03, 0x1f]") bitsBase = bits & 0xffffff if not (bitsBase >= 0x8000 and bitsBase <= 0x7fffff): raise Exception("Second part of bits should be in [0x8000, 0x7fffff]")