Page MenuHomePhabricator

[electrum] use the default sequence as fallback for Transaction.txinputs()
ClosedPublic

Authored by PiRK on Sep 6 2023, 07:06.

Details

Summary

The sequence is not necessarily defined for transaction inputs. As the tx size estimation now depends on txinputs, it needs to work when building a fresh transaction from inputs and outputs. Use the default sequence, like the rest of the Transaction code does in this case.

Add a unit test to catch this particular regression.

Also add __hash__ methods to the various objects so that TxInput can be used in sets. This simplifies the comparison of randomized lists of inputs.

Test Plan

python test_runner.py

In the application, go to the send tab, paste an address and type in a value, click "preview" and check that there is no error pop-up.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable