Browse Source

feat(rpc): add block height to session response

master
theborakompanioni 2 years ago
parent
commit
638200d346
No known key found for this signature in database
GPG Key ID: E8070AF0053AAC0D
  1. 2
      docs/api/wallet-rpc.yaml
  2. 5
      src/jmclient/wallet_rpc.py

2
docs/api/wallet-rpc.yaml

@ -849,6 +849,8 @@ components:
type: string
rescanning:
type: boolean
block_height:
type: integer
ListUtxosResponse:
type: object
properties:

5
src/jmclient/wallet_rpc.py

@ -717,6 +717,8 @@ class JMWalletDaemon(Service):
# rescanning, but that would be a strange scenario:
rescanning = False
block_height = None
if self.services["wallet"]:
if self.services["wallet"].isRunning():
rescanning, _ = self.services["wallet"].get_backend_wallet_rescan_status()
@ -725,6 +727,8 @@ class JMWalletDaemon(Service):
# by the call to `check_cookie_if_present` above.
auth_header = request.getHeader('Authorization')
if auth_header is not None:
block_height = self.services["wallet"].current_blockheight
if self.coinjoin_state == CJ_TAKER_RUNNING and \
self.tumbler_options is not None:
if self.taker is not None and not self.taker.aborted:
@ -751,6 +755,7 @@ class JMWalletDaemon(Service):
offer_list=offer_list,
nickname=nickname,
rescanning=rescanning,
block_height=block_height,
)
@app.route('/wallet/<string:walletname>/taker/direct-send', methods=['POST'])

Loading…
Cancel
Save