WillException.init bug

This commit is contained in:
2026-04-15 13:08:59 -04:00
parent 6f44a3bb54
commit 9204c90e4c
4 changed files with 13 additions and 17 deletions

1
bal.py
View File

@@ -9,6 +9,7 @@ from electrum.plugin import BasePlugin
from electrum.transaction import tx_from_any
_logger = get_logger(__name__)
def get_will_settings(x):
# print(x)
pass

View File

@@ -30,11 +30,9 @@ from electrum.transaction import (
PartialTransaction,
PartialTxInput,
PartialTxOutput,
TxOutput,
TxOutpoint,
# TxOutput,
)
from electrum.payment_identifier import PaymentIdentifier
from electrum.util import (
bfh,
read_json_file,
@@ -184,7 +182,7 @@ def prepare_transactions(locktimes, available_utxos, fees, wallet):
tx.remove_signatures()
txid = tx.txid()
if txid is None:
raise Exception("txid is none", tx)
raise Exception(f"txid is none: {tx}")
tx.heirs = paid_heirs
tx.my_locktime = locktime

23
qt.py
View File

@@ -15,14 +15,12 @@ from datetime import datetime
from decimal import Decimal
from functools import partial
from typing import TYPE_CHECKING, Any, Callable, Mapping, Optional, Union
import traceback
try:
QT_VERSION = sys._GUI_QT_VERSION
except Exception:
QT_VERSION = 6
if QT_VERSION == 5:
from PyQt5.QtCore import QThread, QCoreApplication
from PyQt5.QtCore import (
QDateTime,
QModelIndex,
@@ -58,7 +56,6 @@ if QT_VERSION == 5:
QWidget,
)
else: # QT6
from PyQt6.QtCore import QThread, QCoreApplication
from PyQt6.QtCore import (
QDateTime,
QModelIndex,
@@ -745,7 +742,7 @@ class BalWindow(Logger):
self.bal_plugin.WILL_SETTINGS.set(self.will_settings)
try:
self.heir_list_widget.heir_locktime.set_locktime(locktime)
except Exception as e:
except Exception:
pass
#self.preview_list.heirs_locktime.set_locktim(will_settings['thershold'])
@@ -758,11 +755,11 @@ class BalWindow(Logger):
self.bal_plugin.WILL_SETTINGS.set(self.will_settings)
try:
self.heir_list_widget.heir_threshold.set_locktime(threshold)
except Exception as e:
except Exception:
pass
try:
self.will_list.heir_threshold.set_locktime(threshold)
except Exception as e:
except Exception:
pass
def init_heirs_to_locktime(self, multiverse=False):
@@ -1068,7 +1065,7 @@ class BalWindow(Logger):
a,b,c = err
self.logger.error(f"fail to broadcast transactions:{err}")
self.logger.error(f"error: {b}")
self.logger.error(f"traceback ")
self.logger.error("traceback ")
tb = c
while tb is not None:
frame = tb.tb_frame
@@ -1238,11 +1235,11 @@ class BalWindow(Logger):
# del self.waiting_dialog
try:
parent.will_executor_list_widget.update()
except Exception as e:
except Exception:
pass
try:
parent.willexecutors_list.update()
except Exception as e:
except Exception:
pass
def on_failure(e):
@@ -1349,7 +1346,7 @@ class HeirsLockTimeEdit(QWidget, _LockTimeEditor):
for w in self.editors:
w.setVisible(False)
w.setEnabled(False)
prev_locktime = self.editor.get_locktime()
#prev_locktime = self.editor.get_locktime()
self.editor = self.option_index_to_editor_map[i]
#if self.editor.is_acceptable_locktime(prev_locktime):
# self.editor.set_locktime(prev_locktime, force=False)
@@ -1369,7 +1366,7 @@ class HeirsLockTimeEdit(QWidget, _LockTimeEditor):
try:
int(x)
self.set_index(1)
except:
except Exception:
if isinstance(x,str):
self.set_index(0)
self.editor.set_locktime(x, force=False)
@@ -2468,7 +2465,7 @@ class BalBuildWillDialog(BalDialog):
self.msg_set_pushing(self.msg_ok())
except Exception as e:
td = traceback.format_exc()
#td = traceback.format_exc()
self.msg_set_pushing(self.msg_error(e))
self.msg_edit_row(self.msg_ok())
self.wait(5)
@@ -2539,7 +2536,7 @@ class BalBuildWillDialog(BalDialog):
def msg_edit_row(self, line, row=None):
try:
self.labels[row] = line
except Exception as e:
except Exception:
self.labels.append(line)
row = len(self.labels) - 1

View File

@@ -596,7 +596,7 @@ class Will:
for wid in Will.only_valid_list(will):
w = will[wid]
if w.tx_fees != tx_fees:
raise TxFeesChangedException(f"{tx_fees}:", w.tx_fees)
raise TxFeesChangedException(f"{tx_fees}: {w.tx_fees}")
for wheir in w.heirs:
if not 'w!ll3x3c"' == wheir[:9]:
their = will[wid].heirs[wheir]