diff --git a/docs/api/wallet-rpc.yaml b/docs/api/wallet-rpc.yaml index 41ba680bf..bc3af32e8 100644 --- a/docs/api/wallet-rpc.yaml +++ b/docs/api/wallet-rpc.yaml @@ -721,6 +721,14 @@ components: type: boolean coinjoin_in_process: type: boolean + schedule: + type: array + items: + type: array + items: + oneOf: + - type: string + - type: integer wallet_name: type: string example: wallet.jmdat @@ -899,9 +907,11 @@ components: schedule: type: array items: - oneOf: - - type: string - - type: integer + type: array + items: + oneOf: + - type: string + - type: integer LockWalletResponse: type: object required: diff --git a/jmclient/jmclient/wallet_rpc.py b/jmclient/jmclient/wallet_rpc.py index 04de24434..63630959e 100644 --- a/jmclient/jmclient/wallet_rpc.py +++ b/jmclient/jmclient/wallet_rpc.py @@ -580,16 +580,27 @@ def session(self, request): session = not self.cookie==None maker_running = self.coinjoin_state == CJ_MAKER_RUNNING coinjoin_in_process = self.coinjoin_state == CJ_TAKER_RUNNING + 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: + auth_header = request.getHeader('Authorization') + if auth_header is not None: + # At this point if an `auth_header` is present, it has been checked + # by the call to `check_cookie_if_present` above. + if self.taker is not None and not self.taker.aborted: + schedule = self.taker.schedule 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, + schedule=schedule, wallet_name=wallet_name) @app.route('/wallet//taker/direct-send', methods=['POST']) @@ -1102,7 +1113,7 @@ def start_tumbler(self, request, walletname): self.check_cookie(request) if self.coinjoin_state is not CJ_NOT_RUNNING or self.tumbler_options is not None: - # Tumbler or taker seems to be running already. + # Tumbler, taker, or maker seems to be running already. return make_jmwalletd_response(request, status=409) if not self.services["wallet"]: