Page MenuHomePhabricator

[electrum] coinchooser bucket refactoring
ClosedPublic

Authored by PiRK on Sep 29 2023, 09:55.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC4be2c448f6af: [electrum] coinchooser bucket refactoring
Summary

Clarify the coinchooser code by removing the keys() indirection. Store TxInput objects in the bucket (avoid calling TxInput.from_coin_dict twice.

What is currently preventing CoinChooserBase.make_tx from taking a list of TxInput coins instead of coin dicts is the lack of a height field in TxInput.
I will fix this in a separate diff.

Test Plan

send a transaction

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Sep 29 2023, 09:55
Fabien added a subscriber: Fabien.
Fabien added inline comments.
electrum/electrumabc/coinchooser.py
97 ↗(On Diff #42450)

could be self.min_height = min(self.min_height, coin_dict["height"]) if self.min_height is not None else coin_dict["height"] ?

This revision is now accepted and ready to land.Sep 29 2023, 16:05
This revision was automatically updated to reflect the committed changes.