dust bug fix

This commit is contained in:
2026-02-09 11:58:07 -04:00
parent 2a4eab81fd
commit 0df6786f50
4 changed files with 108 additions and 44 deletions

32
qt.py
View File

@@ -145,7 +145,7 @@ from electrum.util import (
from .bal import BalPlugin
from .bal_resources import DEFAULT_ICON, icon_path
from .heirs import Heirs
from .heirs import (Heirs,HEIR_REAL_AMOUNT,HEIR_DUST_AMOUNT)
from .util import Util
from .will import (
AmountException,
@@ -473,7 +473,7 @@ class BalWindow(Logger):
self.bal_plugin, update=False, bal_window=self
)
if not self.heirs:
self.heirs = Heirs._validate(Heirs(self.wallet.db))
self.heirs = Heirs._validate(Heirs(self.wallet))
if not self.will:
self.will = self.wallet.db.get_dict("will")
Util.fix_will_tx_fees(self.will)
@@ -655,6 +655,7 @@ class BalWindow(Logger):
Will.normalize_will(self.willitems, self.wallet)
def build_will(self, ignore_duplicate=True, keep_original=True):
_logger.debug("building will...")
will = {}
willtodelete = []
willtoappend = {}
@@ -670,6 +671,9 @@ class BalWindow(Logger):
if Willexecutors.is_selected(w):
f = True
if not f:
_logger.error(
"No Will-Executor or backup transaction selected"
)
raise NoWillExecutorNotPresent(
"No Will-Executor or backup transaction selected"
)
@@ -680,7 +684,8 @@ class BalWindow(Logger):
None,
self.date_to_check,
)
self.logger.info(txs)
self.logger.info(f"txs built: {txs}")
creation_time = time.time()
if txs:
for txid in txs:
@@ -699,7 +704,13 @@ class BalWindow(Logger):
tx["txchildren"] = []
will[txid] = WillItem(tx, _id=txid, wallet=self.wallet)
self.update_will(will)
else:
self.logger.info("No transactions was built")
self.logger.info(f"will-settings: {self.will_settings}")
self.logger.info(f"date_to_check:{self.date_to_check}")
self.logger.info(f"heirs: {self.heirs}")
except Exception as e:
self.logger.info(f"Exception build_will: {e}")
raise e
pass
return self.willitems
@@ -2110,7 +2121,7 @@ class BalBuildWillDialog(BalDialog):
_logger.debug("no heirs")
self.msg_set_checking("No Heirs")
except NotCompleteWillException as e:
_logger.debug("not complete", e)
_logger.debug(f"not complete {e} true")
message = False
have_to_build = True
if isinstance(e, HeirChangeException):
@@ -2124,7 +2135,7 @@ class BalBuildWillDialog(BalDialog):
elif isinstance(e, HeirNotFoundException):
message = "Heir not found"
if message:
_logger.debug("message")
_logger.debug(f"message: {message}")
self.msg_set_checking(message)
else:
self.msg_set_checking("New")
@@ -2140,6 +2151,15 @@ class BalBuildWillDialog(BalDialog):
except Exception as e:
self.msg_set_building(self.msg_error(e))
return False, None
excluded_heirs=[]
for wid in Will.only_valid(self.bal_window.willitems):
heirs=self.bal_window.willitems[wid].heirs
for hid,heir in heirs.items():
if "DUST" in str(heir[HEIR_REAL_AMOUNT]):
self.msg_set_status(f"<font color=\"red\">{hid},{heir[HEIR_DUST_AMOUNT]} is DUST",None,f"Excluded from will {wid}</font>")
have_to_sign = False
for wid in Will.only_valid(self.bal_window.willitems):
if not self.bal_window.willitems[wid].get_status("COMPLETE"):
@@ -2399,8 +2419,6 @@ class BalBuildWillDialog(BalDialog):
self.password = self.bal_window.get_wallet_password(msg, parent=self)
def msg_edit_row(self, line, row=None):
_logger.debug(f"{row},{line}")
try:
self.labels[row] = line
except Exception: