1
0

initial testnet support (petrkr)

This commit is contained in:
ThomasV
2017-01-07 16:58:23 +01:00
parent 9138cf3cb8
commit d042d6e970
8 changed files with 82 additions and 71 deletions

View File

@@ -38,7 +38,7 @@ from decimal import Decimal
import util
from util import print_msg, format_satoshis, print_stderr
import bitcoin
from bitcoin import is_address, hash_160_to_bc_address, hash_160, COIN, TYPE_ADDRESS
from bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
from transaction import Transaction
import paymentrequest
from paymentrequest import PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED
@@ -251,7 +251,7 @@ class Commands:
"""Create multisig address"""
assert isinstance(pubkeys, list), (type(num), type(pubkeys))
redeem_script = Transaction.multisig_script(pubkeys, num)
address = hash_160_to_bc_address(hash_160(redeem_script.decode('hex')), 5)
address = bitcoin.hash160_to_p2sh(hash_160(redeem_script.decode('hex')))
return {'address':address, 'redeemScript':redeem_script}
@command('w')
@@ -746,6 +746,7 @@ def get_parser():
group.add_argument("-D", "--dir", dest="electrum_path", help="electrum directory")
group.add_argument("-P", "--portable", action="store_true", dest="portable", default=False, help="Use local 'electrum_data' directory")
group.add_argument("-w", "--wallet", dest="wallet_path", help="wallet path")
group.add_argument("--testnet", action="store_true", dest="testnet", default=False, help="Use Testnet")
# create main parser
parser = argparse.ArgumentParser(
parents=[parent_parser],