vbuterin / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
1.28k stars 856 forks source link

Auto-detect testnet for unspent/fetchtx #129

Closed wizardofozzie closed 8 years ago

wizardofozzie commented 8 years ago

Any input on how to clean up the code would be appreciated, but the functionality is sound eg is_testnet(["mqA28xiLNGAMdggwf3eihB533MNYnmxwx3","muCRMGBLnfmQC6Y4vBWZJfbPFTFQgTZVZp"])

set_network("b6bdca9c8550fc41e064bbf2dd8f47095477a90500669bd5e68045720c6a4735")  # a testnet txid
>>> "testnet"

Also, see my fork (NB some code deviates from @vbuterin pybitcointools, eg safe_unhexlify is similar to safe_frox_hex but also acts to "unhexlify JSON hex")