mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-22 08:08:11 +00:00
Fix unorderable types error&make code more uniform
This commit is contained in:
parent
14a25a6fd9
commit
980363b6e1
@ -26,9 +26,9 @@ def select_outputs_greedy(unspent, min_value):
|
||||
key_func = lambda utxo: utxo.value
|
||||
if greaters:
|
||||
# Not-empty. Find the smallest greater.
|
||||
min_greater = min(greaters)
|
||||
min_greater = min(greaters, key=key_func)
|
||||
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.
|
||||
# Rearrange them from biggest to smallest. We want to use the least
|
||||
# amount of inputs as possible.
|
||||
|
Loading…
Reference in New Issue
Block a user