Browse Source

fix wallet syncing

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

4
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]')
sync_wallet(wallet, fast=options.fastsync)
wallet.save()
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
#Now the wallet/data is prepared, execute the script according to the method
if method == "display":
return wallet_display(wallet, options.gaplimit, options.showprivkey)

4
jmclient/jmclient/yieldgenerator.py

@ -240,7 +240,9 @@ 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"
sync_wallet(wallet, fast=options.fastsync)
while not jm_single().bc_interface.wallet_synced:
sync_wallet(wallet, fast=options.fastsync)
maker = ygclass(wallet, [options.txfee, cjfee_a, cjfee_r,
options.ordertype, options.minsize])

3
scripts/add-utxo.py

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

3
scripts/jmtainter.py

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

3
scripts/sendpayment.py

@ -134,7 +134,8 @@ 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.
sync_wallet(wallet, fast=options.fastsync)
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)
return

3
scripts/tumbler.py

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

Loading…
Cancel
Save