fix #2270: height sorting can use negative value
This commit is contained in:
parent
c506c3e720
commit
31cd9753aa
|
@ -223,7 +223,7 @@ class CoinChooserOldestFirst(CoinChooserBase):
|
||||||
def choose_buckets(self, buckets, sufficient_funds, penalty_func):
|
def choose_buckets(self, buckets, sufficient_funds, penalty_func):
|
||||||
'''Spend the oldest buckets first.'''
|
'''Spend the oldest buckets first.'''
|
||||||
# Unconfirmed coins are young, not old
|
# Unconfirmed coins are young, not old
|
||||||
adj_height = lambda height: 99999999 if height == 0 else height
|
adj_height = lambda height: 99999999 if height <= 0 else height
|
||||||
buckets.sort(key = lambda b: max(adj_height(coin['height'])
|
buckets.sort(key = lambda b: max(adj_height(coin['height'])
|
||||||
for coin in b.coins))
|
for coin in b.coins))
|
||||||
selected = []
|
selected = []
|
||||||
|
|
Loading…
Reference in New Issue