default_will_settings

This commit is contained in:
bitcoinafterlife 2025-11-29 15:02:03 -04:00
parent 7c1fc04add
commit e5e342649f
Signed by: bitcoinafterlife
GPG Key ID: FE756706E833E0D1
3 changed files with 15 additions and 7 deletions

2
bal.py
View File

@ -132,3 +132,5 @@ class BalPlugin(BasePlugin):
will_settings['locktime']='1y'
return will_settings
def default_will_settings(self):
return {}

View File

@ -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 = ""

13
qt.py
View File

@ -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):