forked from LBRYCommunity/lbry-sdk
more accurate coin selection strategy name
This commit is contained in:
parent
4a24cc0095
commit
24e8a3c62e
2 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ class TestCoinSelectionTests(BaseSelectionTestCase):
|
||||||
utxo(11*CENT, height=5),
|
utxo(11*CENT, height=5),
|
||||||
)
|
)
|
||||||
selector = CoinSelector(utxo_pool, 20*CENT, 0)
|
selector = CoinSelector(utxo_pool, 20*CENT, 0)
|
||||||
match = selector.select("confirmed_only")
|
match = selector.select("prefer_confirmed")
|
||||||
self.assertEqual([5, 5], [c.txo.tx_ref.height for c in match])
|
self.assertEqual([5, 5], [c.txo.tx_ref.height for c in match])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class CoinSelector:
|
||||||
)
|
)
|
||||||
|
|
||||||
@strategy
|
@strategy
|
||||||
def confirmed_only(self) -> List[basetransaction.BaseOutputEffectiveAmountEstimator]:
|
def prefer_confirmed(self) -> List[basetransaction.BaseOutputEffectiveAmountEstimator]:
|
||||||
self.txos = [t for t in self.txos if t.txo.tx_ref and t.txo.tx_ref.height > 0] or self.txos
|
self.txos = [t for t in self.txos if t.txo.tx_ref and t.txo.tx_ref.height > 0] or self.txos
|
||||||
self.available = sum(c.effective_amount for c in self.txos)
|
self.available = sum(c.effective_amount for c in self.txos)
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue