mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-12-27 17:08:09 +00:00
Merge pull request #177 from kristjanr/develop
Fix unorderable types error&make code more uniform
This commit is contained in:
commit
572667c69c
@ -26,9 +26,9 @@ def select_outputs_greedy(unspent, min_value):
|
|||||||
key_func = lambda utxo: utxo.value
|
key_func = lambda utxo: utxo.value
|
||||||
if greaters:
|
if greaters:
|
||||||
# Not-empty. Find the smallest greater.
|
# Not-empty. Find the smallest greater.
|
||||||
min_greater = min(greaters)
|
min_greater = min(greaters, key=key_func)
|
||||||
change = min_greater.value - min_value
|
change = min_greater.value - min_value
|
||||||
return [min_greater], change
|
return [min_greater], "Change: %d Satoshis" % change
|
||||||
# Not found in greaters. Try several lessers instead.
|
# Not found in greaters. Try several lessers instead.
|
||||||
# Rearrange them from biggest to smallest. We want to use the least
|
# Rearrange them from biggest to smallest. We want to use the least
|
||||||
# amount of inputs as possible.
|
# amount of inputs as possible.
|
||||||
|
Loading…
Reference in New Issue
Block a user