spesmilo / spesmilo/electrum

IndexError: list index out of range

Open
#6,447 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

how-to-reproduce?
Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

Crash Report

This crash report was reported through the automatic crash reporting system 🤖

Traceback

  File "electrum\gui\qt\main_window.py", line 1574, in do_pay
  File "electrum\gui\qt\main_window.py", line 1588, in do_pay_invoice
  File "electrum\gui\qt\main_window.py", line 1628, in pay_onchain_dialog
  File "electrum\gui\qt\confirm_tx_dialog.py", line 116, in have_enough_funds_assuming_zero_fees
  File "electrum\gui\qt\main_window.py", line 1617, in <lambda>
  File "electrum\wallet.py", line 1191, in make_unsigned_transaction
  File "electrum\coinchooser.py", line 332, in make_tx
  File "electrum\coinchooser.py", line 427, in choose_buckets
  File "electrum\coinchooser.py", line 427, in <listcomp>
  File "electrum\coinchooser.py", line 456, in penalty
  File "electrum\coinchooser.py", line 321, in tx_from_buckets
  File "electrum\coinchooser.py", line 235, in _construct_tx_from_selected_buckets

IndexError: list index out of range

Reporter

This issue was reported by 35 user(s):

Electrum Version Python Version Operating System Wallet Type Locale Stack
4.0.2 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 09:44:33) [MSC v.1900 32 bit (Intel)] Windows-2012ServerR2-6.3.9600 imported en_US
4.0.2 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 09:44:33) [MSC v.1900 32 bit (Intel)] Windows-2012ServerR2-6.3.9600 imported en_US
4.0.2 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 09:44:33) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 2fa en_US
4.0.4 3.7.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.7.0-kali3-amd64-x86_64-with-debian-kali-rolling imported en_US
4.0.4 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported vi_VN
4.0.4 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported vi_VN
4.0.4 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 imported uk_UA
4.0.7 3.7.9 (default, Sep 11 2020, 17:18:37) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-18.7.0-x86_64-i386-64bit imported ?
4.0.7 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard pt_BR
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported sk_SK
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported sk_SK
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported sk_SK
4.0.5 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
4.0.5 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 imported ru_RU
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 imported,standard en_US
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard en_US
4.0.9 3.7.9 (default, Sep 11 2020, 17:18:37) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-19.6.0-x86_64-i386-64bit standard ?
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 standard,imported en_US
4.0.9 3.7.9 (default, Sep 11 2020, 17:18:37) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-20.1.0-x86_64-i386-64bit imported,standard ?
4.0.9 3.7.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.89-1-MANJARO-x86_64-with-arch-Manjaro-Linux standard,imported de_CH
4.0.9 3.7.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.4.89-1-MANJARO-x86_64-with-arch-Manjaro-Linux standard,imported de_CH
4.0.9 3.7.9 (default, Jun 28 2018, 19:01:02) [GCC 5.4.0 20160609] Linux-5.3.0-kali2-amd64-x86_64-with-debian-kali-rolling standard en_US
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.18362-SP0 imported,standard en_US
4.0.9 3.7.9 (default, Sep 11 2020, 17:18:37) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-20.3.0-x86_64-i386-64bit imported ?
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 imported es_AR
4.1.2 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard en_IN
4.1.2 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928 32 bit (Intel)] Windows-10-10.0.19041-SP0 standard en_IN
4.1.2 3.7.10 (default, Mar 31 2021, 13:19:38) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-20.4.0-x86_64-i386-64bit standard ?
4.1.2 3.7.10 (default, Mar 31 2021, 13:19:38) [Clang 11.0.0 (clang-1100.0.33.17)] Darwin-18.7.0-x86_64-i386-64bit imported,standard ?
4.1.2 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928 32 bit (Intel)] Windows-10-10.0.14393-SP0 imported zh_CN
4.1.2 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928 32 bit (Intel)] Windows-10-10.0.17763-SP0 imported ru_RU
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.19041-SP0 imported en_US
4.0.9 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] Linux-5.10.0-19-amd64-x86_64-with-glibc2.31 imported en_GB
4.0.9 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] Windows-10-10.0.16299-SP0 2fa en_US

Additional Information

Tried to create an op_return transaction: OP_RETURN 830a00b7c030d02376f039489c9cb362, 0
Clicked on Pay...


547


Pay to: OP_RETURN f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2, Amount: 0


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the OP_RETURN payment flow from the report, then trace the call chain through electrum/gui/qt/main_window.py, electrum/gui/qt/confirm_tx_dialog.py, electrum/wallet.py, and electrum/coinchooser.py. Focus on the failing paths around make_unsigned_transaction, choose_buckets, penalty, and _construct_tx_from_selected_buckets. Done means the reported OP_RETURN transaction no longer raises IndexError during Pay.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.