check alive updated
This commit is contained in:
19
heirs.py
19
heirs.py
@@ -341,7 +341,6 @@ class Heirs(dict, Logger):
|
||||
def normalize_perc(
|
||||
self, heir_list, total_balance, relative_balance, wallet, real=False
|
||||
):
|
||||
print("relative balance", relative_balance)
|
||||
amount = 0
|
||||
for key, v in heir_list.items():
|
||||
try:
|
||||
@@ -426,15 +425,7 @@ class Heirs(dict, Logger):
|
||||
self, balance, total_fees, wallet, willexecutor=False, from_locktime=0
|
||||
):
|
||||
if balance<total_fees or balance < wallet.dust_threshold():
|
||||
print("balance < total_fees")
|
||||
raise BalanceTooLowException(balance,wallet.dust_threshold(),total_fees)
|
||||
print("prepare lists")
|
||||
print("balance",balance)
|
||||
print("total fees",total_fees)
|
||||
print("willexecutor", willexecutor)
|
||||
print("from_locktime", from_locktime)
|
||||
print("wallet",wallet)
|
||||
print("dust threshold",wallet.dust_threshold())
|
||||
willexecutors_amount = 0
|
||||
willexecutors = {}
|
||||
heir_list = {}
|
||||
@@ -462,8 +453,6 @@ class Heirs(dict, Logger):
|
||||
f"heir excluded from will locktime({locktime}){Util.int_locktime(locktime)}<minimum{from_locktime}"
|
||||
),
|
||||
heir_list.update(willexecutors)
|
||||
print("willexecutor amount", willexecutors_amount)
|
||||
print("heir_list",heir_list)
|
||||
newbalance -= willexecutors_amount
|
||||
if newbalance < 0:
|
||||
raise WillExecutorFeeException(willexecutor)
|
||||
@@ -474,9 +463,7 @@ class Heirs(dict, Logger):
|
||||
percent_amount,
|
||||
fixed_amount_with_dust,
|
||||
) = self.fixed_percent_lists_amount(from_locktime, wallet.dust_threshold())
|
||||
print("qua non ci arriva 1")
|
||||
if fixed_amount > newbalance:
|
||||
print(fixed_heirs,newbalance,fixed_amount)
|
||||
fixed_amount = self.normalize_perc(
|
||||
fixed_heirs, newbalance, fixed_amount, wallet
|
||||
)
|
||||
@@ -485,15 +472,12 @@ class Heirs(dict, Logger):
|
||||
heir_list.update(fixed_heirs)
|
||||
|
||||
newbalance -= fixed_amount
|
||||
print("new balance", newbalance)
|
||||
if newbalance > 0:
|
||||
perc_amount = self.normalize_perc(
|
||||
percent_heirs, newbalance, percent_amount, wallet
|
||||
)
|
||||
print("normalize perc", perc_amount)
|
||||
newbalance -= perc_amount
|
||||
heir_list.update(percent_heirs)
|
||||
print("newbalance2",newbalance)
|
||||
if newbalance > 0:
|
||||
newbalance += fixed_amount
|
||||
fixed_amount = self.normalize_perc(
|
||||
@@ -514,7 +498,6 @@ class Heirs(dict, Logger):
|
||||
locktimes[locktime] = {key: value}
|
||||
else:
|
||||
locktimes[locktime][key] = value
|
||||
print(2)
|
||||
return locktimes, onlyfixed
|
||||
|
||||
def is_perc(self, key):
|
||||
@@ -582,11 +565,9 @@ class Heirs(dict, Logger):
|
||||
continue
|
||||
if locktimes:
|
||||
try:
|
||||
print(3)
|
||||
txs = prepare_transactions(
|
||||
locktimes, available_utxos[:], fees, wallet
|
||||
)
|
||||
print(4)
|
||||
if not txs:
|
||||
return {}
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user