Browse Source

fix: include schedule in session instead of status flag

master
Daniel 4 years ago
parent
commit
ab2803eca0
No known key found for this signature in database
GPG Key ID: 3FB015F7E1AA3AFB
  1. 9
      docs/api/wallet-rpc.yaml
  2. 12
      jmclient/jmclient/wallet_rpc.py

9
docs/api/wallet-rpc.yaml

@ -713,7 +713,6 @@ components:
- session
- maker_running
- coinjoin_in_process
- coinjoin_is_part_of_schedule
- wallet_name
properties:
session:
@ -722,8 +721,12 @@ components:
type: boolean
coinjoin_in_process:
type: boolean
coinjoin_is_part_of_schedule:
type: boolean
schedule:
type: array
items:
oneOf:
- type: string
- type: integer
wallet_name:
type: string
example: wallet.jmdat

12
jmclient/jmclient/wallet_rpc.py

@ -580,18 +580,26 @@ class JMWalletDaemon(Service):
session = not self.cookie==None
maker_running = self.coinjoin_state == CJ_MAKER_RUNNING
coinjoin_in_process = self.coinjoin_state == CJ_TAKER_RUNNING
coinjoin_is_part_of_schedule = self.coinjoin_state == CJ_TAKER_RUNNING and self.tumbler_options is not None
schedule = None
if self.services["wallet"]:
if self.services["wallet"].isRunning():
wallet_name = self.wallet_name
if self.coinjoin_state == CJ_TAKER_RUNNING and self.tumbler_options is not None:
logsdir = os.path.join(os.path.dirname(jm_single().config_location), "logs")
sfile = os.path.join(logsdir, self.tumbler_options['schedulefile'])
res, schedule = get_schedule(sfile)
if not res:
schedule = None
else:
wallet_name = "not yet loaded"
else:
wallet_name = "None"
return make_jmwalletd_response(request,session=session,
maker_running=maker_running,
coinjoin_in_process=coinjoin_in_process,
coinjoin_is_part_of_schedule=coinjoin_is_part_of_schedule,
schedule=schedule,
wallet_name=wallet_name)
@app.route('/wallet/<string:walletname>/taker/direct-send', methods=['POST'])

Loading…
Cancel
Save