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

Wallet becomes unusable after trying to send funds from the wallet to itself. #2475

Open
oren-z0 opened this issue Nov 5, 2024 · 1 comment · May be fixed by #2476
Open

Wallet becomes unusable after trying to send funds from the wallet to itself. #2475

oren-z0 opened this issue Nov 5, 2024 · 1 comment · May be fixed by #2476

Comments

@oren-z0
Copy link

oren-z0 commented Nov 5, 2024

Describe the bug
Wallet becomes unusable after sending funds from the wallet to itself.

To Reproduce

  1. Remove ~/.specter-dev and /tmp/specter_btc_regtest_plain_datadir if exist.
  2. Activate the virtualenv and start bitcoind on regtest with: python3 -m cryptoadvance.specter bitcoind.
  3. Activate the virtualenv in a new terminal and start specter-desktop with: python3 -m cryptoadvance.specter server --config DevelopmentConfig --debug.
  4. Setup the connection to bitcoin-core.
  5. Create a new "Bitcoin Core" hotwallet-device named "core1" and a new wallet "wallet1".
  6. Restart the bitcoind process so it will start mining to the first address of "wallet1".
  7. Create a second "Bitcoin Core" hotwallet-device named "core2" and a new wallet "wallet2".
  8. You will be able to send funds from wallet1 to wallet2 and vice versa.
  9. Trying send funds from a wallet1 to itself will result in a "list index out of range" error, and the wallet will become unusable.

Debug logs:

Exception in thread Thread-1142 (_update):
Traceback (most recent call last):
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 721, in check_utxo
    searched_vout = [
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/util/flask.py", line 32, in run
    super().run()
  File "/usr/local/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/managers/wallet_manager.py", line 243, in _update
    self.wallets[wallet_name].update()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 497, in update
    self.getdata()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 745, in getdata
    self.check_utxo()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 741, in check_utxo
    raise SpecterError(f"Failed to load utxos, {type(e).__name__}: {e}")
cryptoadvance.specter.specter_error.SpecterError: Failed to load utxos, IndexError: list index out of range

Expected behavior
Wallet should be able to send funds to its own address.

Screenshots
https://v.nostr.build/iNEmbAfNpV96Vcfu.mov

Desktop (please complete the following information):

  • Where is your node running: Mac
  • Where is your specter running: Mac
  • If you're running a binary, which OS: Mac OSX
  • Browser: Chrome
  • Specter Version: Running latest commit in dev mode with regtest: 0ac4640
@oren-z0
Copy link
Author

oren-z0 commented Nov 5, 2024

#2467 doesn't solve the problem.
I'm getting a different error message: "Failed to load utxos, KeyError: '51845...'":

Traceback (most recent call last):
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 699, in check_utxo
    tx: WalletAwareTxItem = txlist_dict[utxo_txid]
KeyError: '518457cbb7fa87fe90980b32890721fef2a6c850497369484423ae361dcb2ae8'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 705, in check_utxo
    tx: WalletAwareTxItem = txlist_dict[utxo_txid]
KeyError: '518457cbb7fa87fe90980b32890721fef2a6c850497369484423ae361dcb2ae8'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/util/flask.py", line 32, in run
    super().run()
  File "/usr/local/Cellar/[email protected]/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/managers/wallet_manager.py", line 243, in _update
    self.wallets[wallet_name].update()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 497, in update
    self.getdata()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 756, in getdata
    self.check_utxo()
  File "/Users/oren/private_workspace/specter-desktop/src/cryptoadvance/specter/wallet/wallet.py", line 752, in check_utxo
    raise SpecterError(f"Failed to load utxos, {type(e).__name__}: {e}")
cryptoadvance.specter.specter_error.SpecterError: Failed to load utxos, KeyError: '518457cbb7fa87fe90980b32890721fef2a6c850497369484423ae361dcb2ae8'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant