Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: '<' not supported between instances of 'NoneType' and 'int' (for unconfirmed txs) #12

Open
k9ert opened this issue Jan 24, 2023 · 3 comments · May be fixed by #14
Open

TypeError: '<' not supported between instances of 'NoneType' and 'int' (for unconfirmed txs) #12

k9ert opened this issue Jan 24, 2023 · 3 comments · May be fixed by #14
Labels
good first issue Good for newcomers

Comments

@k9ert
Copy link
Collaborator

k9ert commented Jan 24, 2023

This is happening for unconfirmed txs:

[2023-01-24 11:44:15,601] ERROR in controller: Uncaught exception: '<' not supported between instances of 'NoneType' and 'int'
[2023-01-24 11:44:15,606] ERROR in controller: Traceback (most recent call last):
  File "/home/kim/src/specter-desktop/.env/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/kim/src/specter-desktop/.env/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/kim/src/specter-desktop/.env/lib/python3.10/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/home/kim/src/specter-desktop/.env/lib/python3.10/site-packages/cryptoadvance/specterext/stacktrack/controller.py", line 79, in wallets_overview
    txs: list = _extract_txs(wallets)
  File "/home/kim/src/specter-desktop/.env/lib/python3.10/site-packages/cryptoadvance/specterext/stacktrack/controller.py", line 124, in _extract_txs
    return sorted(txs, key=lambda d: d["blockheight"], reverse=True)
TypeError: '<' not supported between instances of 'NoneType' and 'int'

[2023-01-24 11:44:15,607] INFO in _internal: 127.0.0.1 - - [24/Jan/2023 11:44:15] "GET /svc/stacktrack/wallets_overview HTTP/1.1" 500 -
@k9ert
Copy link
Collaborator Author

k9ert commented Jan 24, 2023

Reasonable complaints for unconfirmed Txs:

    # Reverse sort, like wallets do
    return sorted(txs, key=lambda d: d["blockheight"], reverse=True)

k9ert added a commit to k9ert/specterext-stacktrack that referenced this issue Jan 24, 2023
k9ert added a commit that referenced this issue Jan 24, 2023
Mitigate #12: No stacktrace for unconfirmed Txs in Wallet Overview
@k9ert k9ert added the good first issue Good for newcomers label Jan 24, 2023
@moneymanolis
Copy link

My suggestion would be to exclude unconfirmed tx here. Unconfirmed tx amounts shouldn't be considered in the chart yet anyways. @wombat6 what do you think? I love the feature in general. Great work!

@moneymanolis
Copy link

@noubre might be interesting to you.

@PaarthAgarwal PaarthAgarwal linked a pull request Jan 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants