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 from electrum.transaction import tx_from_any
_logger = get_logger(__name__)
def get_will_settings(x): def get_will_settings(x):
# print(x) # print(x)
pass pass

View File

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

23
qt.py
View File

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

View File

@@ -596,7 +596,7 @@ class Will:
for wid in Will.only_valid_list(will): for wid in Will.only_valid_list(will):
w = will[wid] w = will[wid]
if w.tx_fees != tx_fees: 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: for wheir in w.heirs:
if not 'w!ll3x3c"' == wheir[:9]: if not 'w!ll3x3c"' == wheir[:9]:
their = will[wid].heirs[wheir] their = will[wid].heirs[wheir]