Browse Source

fix wallet syncing

master
undeath 8 years ago
parent
commit
34f8600996
  1. 2
      jmclient/jmclient/wallet_utils.py
  2. 2
      jmclient/jmclient/yieldgenerator.py
  3. 1
      scripts/add-utxo.py
  4. 1
      scripts/jmtainter.py
  5. 1
      scripts/sendpayment.py
  6. 1
      scripts/tumbler.py

2
jmclient/jmclient/wallet_utils.py

@ -985,8 +985,8 @@ def wallet_tool_main(wallet_root_path):
# unconfirmed balance is included in the wallet display by default
if 'listunspent_args' not in jm_single().config.options('POLICY'):
jm_single().config.set('POLICY','listunspent_args', '[0]')
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
wallet.save()
#Now the wallet/data is prepared, execute the script according to the method
if method == "display":
return wallet_display(wallet, options.gaplimit, options.showprivkey)

2
jmclient/jmclient/yieldgenerator.py

@ -240,6 +240,8 @@ def ygmain(ygclass, txfee=1000, cjfee_a=200, cjfee_r=0.002, ordertype='swreloffe
if jm_single().config.get("BLOCKCHAIN", "blockchain_source") == "electrum-server":
jm_single().bc_interface.synctype = "with-script"
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
maker = ygclass(wallet, [options.txfee, cjfee_a, cjfee_r,

1
scripts/add-utxo.py

@ -176,6 +176,7 @@ def main():
if options.loadwallet:
wallet_path = get_wallet_path(options.loadwallet, None)
wallet = open_wallet(wallet_path, gap_limit=options.gaplimit)
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
for md, utxos in wallet.get_utxos_by_mixdepth_().items():

1
scripts/jmtainter.py

@ -84,6 +84,7 @@ def cli_get_wallet(wallet_name, sync=True):
"blockchain_source") == "electrum-server":
jm_single().bc_interface.synctype = "with-script"
if sync:
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
return wallet

1
scripts/sendpayment.py

@ -134,6 +134,7 @@ def main():
"blockchain_source") == "electrum-server" and options.makercount != 0:
jm_single().bc_interface.synctype = "with-script"
#wallet sync will now only occur on reactor start if we're joining.
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
if options.makercount == 0:
direct_send(wallet, amount, mixdepth, destaddr, options.answeryes)

1
scripts/tumbler.py

@ -38,6 +38,7 @@ def main():
if jm_single().config.get("BLOCKCHAIN",
"blockchain_source") == "electrum-server":
jm_single().bc_interface.synctype = "with-script"
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options['fastsync'])
#Parse options and generate schedule

Loading…
Cancel
Save