mirror of
https://github.com/JoinMarket-Org/joinmarket-clientserver.git
synced 2026-08-13 12:33:40 +02:00
parent
c1bd773ae0
commit
b83e27c391
6 changed files with 36 additions and 4 deletions
|
|
@ -101,6 +101,13 @@ def get_wallettool_parser():
|
|||
"if your address starts with '3' use 'segwit-p2sh.\n"
|
||||
"Native segwit addresses (starting with 'bc') are"
|
||||
"not yet supported."))
|
||||
parser.add_option('--wallet-password-stdin',
|
||||
action='store_true',
|
||||
default=False,
|
||||
dest='wallet_password_stdin',
|
||||
help='Read wallet password from stdin')
|
||||
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
|
|
@ -1072,7 +1079,7 @@ def create_wallet(path, password, max_mixdepth, wallet_cls=None, **kwargs):
|
|||
|
||||
|
||||
def open_test_wallet_maybe(path, seed, max_mixdepth,
|
||||
test_wallet_cls=SegwitLegacyWallet, **kwargs):
|
||||
test_wallet_cls=SegwitLegacyWallet, wallet_password_stdin=False, **kwargs):
|
||||
"""
|
||||
Create a volatile test wallet if path is a hex-encoded string of length 64,
|
||||
otherwise run open_wallet().
|
||||
|
|
@ -1114,6 +1121,11 @@ def open_test_wallet_maybe(path, seed, max_mixdepth,
|
|||
del kwargs['read_only']
|
||||
return test_wallet_cls(storage, **kwargs)
|
||||
|
||||
if wallet_password_stdin is True:
|
||||
stdin = sys.stdin.read()
|
||||
password = stdin.encode('utf-8')
|
||||
return open_wallet(path, ask_for_password=False, password=password, mixdepth=max_mixdepth, **kwargs)
|
||||
|
||||
return open_wallet(path, mixdepth=max_mixdepth, **kwargs)
|
||||
|
||||
|
||||
|
|
@ -1220,7 +1232,7 @@ def wallet_tool_main(wallet_root_path):
|
|||
|
||||
wallet = open_test_wallet_maybe(
|
||||
wallet_path, seed, options.mixdepth, read_only=read_only,
|
||||
gap_limit=options.gaplimit)
|
||||
wallet_password_stdin=options.wallet_password_stdin, gap_limit=options.gaplimit)
|
||||
|
||||
# this object is only to respect the layering,
|
||||
# the service will not be started since this is a synchronous script:
|
||||
|
|
|
|||
|
|
@ -220,6 +220,11 @@ def ygmain(ygclass, txfee=1000, cjfee_a=200, cjfee_r=0.002, ordertype='swreloffe
|
|||
parser.add_option('-m', '--mixdepth', action='store', type='int',
|
||||
dest='mixdepth', default=None,
|
||||
help="highest mixdepth to use")
|
||||
parser.add_option('--wallet-password-stdin',
|
||||
action='store_true',
|
||||
default=False,
|
||||
dest='wallet_password_stdin',
|
||||
help='Read wallet password from stdin')
|
||||
(options, args) = parser.parse_args()
|
||||
if len(args) < 1:
|
||||
parser.error('Needs a wallet')
|
||||
|
|
@ -248,6 +253,7 @@ def ygmain(ygclass, txfee=1000, cjfee_a=200, cjfee_r=0.002, ordertype='swreloffe
|
|||
wallet_path = get_wallet_path(wallet_name, 'wallets')
|
||||
wallet = open_test_wallet_maybe(
|
||||
wallet_path, wallet_name, options.mixdepth,
|
||||
wallet_password_stdin=options.wallet_password_stdin,
|
||||
gap_limit=options.gaplimit)
|
||||
|
||||
wallet_service = WalletService(wallet)
|
||||
|
|
|
|||
|
|
@ -72,6 +72,11 @@ def add_common_options(parser):
|
|||
.format('random_under_max_order_choose',
|
||||
', '.join(order_choose_algorithms.keys())),
|
||||
dest='order_choose_fn')
|
||||
parser.add_option('--wallet-password-stdin',
|
||||
action='store_true',
|
||||
default=False,
|
||||
dest='wallet_password_stdin',
|
||||
help='Read wallet password from stdin')
|
||||
add_order_choose_short_options(parser)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ def receive_payjoin_main(makerclass):
|
|||
dest='amtmixdepths',
|
||||
help='number of mixdepths in wallet, default 5',
|
||||
default=5)
|
||||
parser.add_option('--wallet-password-stdin',
|
||||
action='store_true',
|
||||
default=False,
|
||||
dest='wallet_password_stdin',
|
||||
help='Read wallet password from stdin')
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
if len(args) < 2:
|
||||
parser.error('Needs a wallet, and a receiving amount in satoshis')
|
||||
|
|
@ -62,6 +68,7 @@ def receive_payjoin_main(makerclass):
|
|||
max_mix_depth = max([options.mixdepth, options.amtmixdepths - 1])
|
||||
wallet = open_test_wallet_maybe(
|
||||
wallet_path, wallet_name, max_mix_depth,
|
||||
wallet_password_stdin=options.wallet_password_stdin,
|
||||
gap_limit=options.gaplimit)
|
||||
|
||||
if jm_single().config.get("BLOCKCHAIN", "blockchain_source") == "electrum-server":
|
||||
|
|
|
|||
|
|
@ -131,7 +131,9 @@ def main():
|
|||
|
||||
wallet_path = get_wallet_path(wallet_name, None)
|
||||
wallet = open_test_wallet_maybe(
|
||||
wallet_path, wallet_name, max_mix_depth, gap_limit=options.gaplimit)
|
||||
wallet_path, wallet_name, max_mix_depth,
|
||||
wallet_password_stdin=options.wallet_password_stdin,
|
||||
gap_limit=options.gaplimit)
|
||||
wallet_service = WalletService(wallet)
|
||||
# in this script, we need the wallet synced before
|
||||
# logic processing for some paths, so do it now:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def main():
|
|||
if options['amtmixdepths'] > max_mix_depth:
|
||||
max_mix_depth = options['amtmixdepths']
|
||||
wallet_path = get_wallet_path(wallet_name, None)
|
||||
wallet = open_test_wallet_maybe(wallet_path, wallet_name, max_mix_depth)
|
||||
wallet = open_test_wallet_maybe(wallet_path, wallet_name, max_mix_depth, wallet_password_stdin=options_org.wallet_password_stdin)
|
||||
wallet_service = WalletService(wallet)
|
||||
# in this script, we need the wallet synced before
|
||||
# logic processing for some paths, so do it now:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue