more accurate coin selection strategy name

This commit is contained in:
Alex Grintsvayg 2019-06-19 10:39:11 -04:00
parent 4a24cc0095
commit 24e8a3c62e
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5
2 changed files with 2 additions and 2 deletions

View file

@ -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])

View file

@ -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 (