This commit is contained in:
2026-02-09 12:01:06 -04:00
parent 0df6786f50
commit 609db44c1a
5 changed files with 129 additions and 83 deletions

16
will.py
View File

@@ -161,6 +161,7 @@ class Will:
"""
def check_anticipate(ow: "WillItem", nw: "WillItem"):
anticipate = Util.anticipate_locktime(ow.tx.locktime, days=1)
if int(nw.tx.locktime) >= int(anticipate):
@@ -297,7 +298,6 @@ class Will:
Will.search_anticipate_rec(will, old_inputs)
def update_will(old_will, new_will):
all_old_inputs = Will.get_all_inputs(old_will, only_valid=True)
all_inputs_min_locktime = Will.get_all_inputs_min_locktime(all_old_inputs)
@@ -439,7 +439,11 @@ class Will:
# check if transactions are stil valid tecnically valid
def check_invalidated(willtree, utxos_list, wallet):
for wid, w in willtree.items():
if not w.father or willtree[w.father].get_status("CONFIRMED") or willtree[w.father].get_status("PENDING"):
if (
not w.father
or willtree[w.father].get_status("CONFIRMED")
or willtree[w.father].get_status("PENDING")
):
for inp in w.tx.inputs():
inp_str = Util.utxo_to_str(inp)
if not inp_str in utxos_list:
@@ -671,11 +675,11 @@ class WillItem(Logger):
}
def set_status(self, status, value=True):
#_logger.trace(
# _logger.trace(
# "set status {} - {} {} -> {}".format(
# self._id, status, self.STATUS[status][1], value
# )
#)
# )
if self.STATUS[status][1] == bool(value):
return None
@@ -886,9 +890,5 @@ class FixedAmountException(AmountException):
pass
def test_check_invalidated():
Will.check_invalidated(will, utxos_list, wallet)