@ -22,9 +22,9 @@ from jmclient import (Taker, load_program_config, get_schedule,
validate_address , jm_single , WalletError ,
choose_orders , choose_sweep_orders ,
cheapest_order_choose , weighted_order_choose ,
Wallet , BitcoinCoreWallet , sync_wallet ,
RegtestBitcoinCoreInterface , estimate_tx_fee ,
direct_send , Segwit Wallet)
sync_wallet , RegtestBitcoinCoreInterface ,
estimate_tx_fee , direct_send , get_wallet_cls ,
BitcoinCore Wallet)
from twisted . python . log import startLogging
from jmbase . support import get_log , debug_dump_object , get_password
from cli_options import get_sendpayment_parser
@ -57,8 +57,6 @@ def main():
parser = get_sendpayment_parser ( )
( options , args ) = parser . parse_args ( )
load_program_config ( )
walletclass = SegwitWallet if jm_single ( ) . config . get (
" POLICY " , " segwit " ) == " true " else Wallet
if options . schedule == ' ' and len ( args ) < 3 :
parser . error ( ' Needs a wallet, amount and destination address ' )
sys . exit ( 0 )
@ -129,12 +127,12 @@ def main():
#to ensure we have enough, must be at least (requested index+1)
max_mix_depth = max ( [ mixdepth + 1 , options . amtmixdepths ] )
if not os . path . exists ( os . path . join ( ' wallets ' , wallet_name ) ) :
wallet = walletclass ( wallet_name , None , max_mix_depth , options . gaplimit )
wallet = get_ wallet_ cls ( ) ( wallet_name , None , max_mix_depth , options . gaplimit )
else :
while True :
try :
pwd = get_password ( " Enter wallet decryption passphrase: " )
wallet = walletclass ( wallet_name , pwd , max_mix_depth , options . gaplimit )
wallet = get_ wallet_ cls ( ) ( wallet_name , pwd , max_mix_depth , options . gaplimit )
except WalletError :
print ( " Wrong password, try again. " )
continue
@ -155,11 +153,6 @@ def main():
direct_send ( wallet , amount , mixdepth , destaddr , options . answeryes )
return
if walletclass == Wallet :
print ( " Only direct sends (use -N 0) are supported for "
" legacy (non-segwit) wallets. " )
return
def filter_orders_callback ( orders_fees , cjamount ) :
orders , total_cj_fee = orders_fees
log . info ( " Chose these orders: " + pprint . pformat ( orders ) )