From e5e342649f36b09abd3a6cc9e3210aaeb9b54a36 Mon Sep 17 00:00:00 2001 From: bitcoinafterlife Date: Sat, 29 Nov 2025 15:02:03 -0400 Subject: [PATCH] default_will_settings --- bal.py | 4 +++- heirs.py | 5 ++++- qt.py | 13 ++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bal.py b/bal.py index e24308e..09c9059 100644 --- a/bal.py +++ b/bal.py @@ -9,7 +9,7 @@ from electrum.transaction import tx_from_any import os json_db.register_dict('heirs', tuple, None) json_db.register_dict('will', lambda x: get_will(x), None) -json_db.register_dict('will_settings', lambda x:x, None) +json_db.register_dict('will_settings', lambda x: x, None) from electrum.logging import get_logger @@ -132,3 +132,5 @@ class BalPlugin(BasePlugin): will_settings['locktime']='1y' return will_settings + def default_will_settings(self): + return {} diff --git a/heirs.py b/heirs.py index e9f132c..4e4c569 100644 --- a/heirs.py +++ b/heirs.py @@ -14,6 +14,7 @@ from electrum.transaction import PartialTxInput, PartialTxOutput,TxOutpoint,Part import datetime import urllib.request import urllib.parse +import random from .util import Util from .willexecutors import Willexecutors if TYPE_CHECKING: @@ -112,7 +113,9 @@ def prepare_transactions(locktimes, available_utxos, fees, wallet): change = get_change_output(wallet, in_amount, out_amount, fee) if change: outputs.append(change) - + for i in range(0,100): + random.shuffle(outputs) + print(outputs) tx = PartialTransaction.from_io(used_utxos, outputs, locktime=Util.parse_locktime_string(locktime,wallet), version=2) if len(description)>0: tx.description = description[:-1] else: tx.description = "" diff --git a/qt.py b/qt.py index 4d53abc..eaf4a1a 100644 --- a/qt.py +++ b/qt.py @@ -628,7 +628,7 @@ class BalWindow(Logger): heir_address.setText(str(heir[0])) heir_amount = PercAmountEdit(self.window.get_decimal_point) if heir: - heir_amount.setText(str(Util.decode_amount(heir[1],self.bal_plugin.config.get_decimal_point()))) + heir_amount.setText(str(Util.decode_amount(heir[1],self.window.get_decimal_point()))) heir_locktime = HeirsLockTimeEdit(self.window,0) if heir: heir_locktime.set_locktime(heir[2]) @@ -1107,7 +1107,6 @@ class BalWindow(Logger): def check_transactions_task(self,will): start = time.time() for wid,w in will.items(): - if w.we: self.waiting_dialog.update("checking transaction: {}\n willexecutor: {}".format(wid,w.we['url'])) w.check_willexecutor() @@ -2194,7 +2193,7 @@ class HeirList(MyTreeView,MessageBoxMixin): stretch_column=self.Columns.NAME, editable_columns=[self.Columns.NAME,self.Columns.ADDRESS,self.Columns.AMOUNT], ) - self.decimal_point = bal_window.bal_plugin.config.get_decimal_point() + self.decimal_point = bal_window.window.get_decimal_point() self.bal_window = bal_window try: @@ -2416,7 +2415,7 @@ class PreviewList(MyTreeView): ) self.parent=parent self.bal_window=bal_window - self.decimal_point=bal_window.bal_plugin.config.get_decimal_point + self.decimal_point=bal_window.window.get_decimal_point self.setModel(QStandardItemModel(self)) self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) @@ -2631,7 +2630,11 @@ class PreviewList(MyTreeView): self.update() def check(self): - self.bal_window.check_transactions(self.bal_window.willitems) + will = {} + for wid, w in self.bal_window.willitems: + if w.get_status("VALID"): + will[wid]=w + self.bal_window.check_transactions(will) self.update() def invalidate_will(self):