1
1
from datetime import datetime
2
- from typing import TYPE_CHECKING , List , Optional , Tuple
2
+ from typing import TYPE_CHECKING , Callable , List , Optional , Sequence , Tuple
3
3
from electrum .bitcoin import address_to_script
4
4
from electrum .plugin import BasePlugin
5
5
from electrum .transaction import PartialTxOutput , PartialTxInput , TxOutpoint
@@ -29,9 +29,9 @@ def nsequence(self, value: int):
29
29
pass # ignore override attempts
30
30
31
31
class TimelockRecoveryContext :
32
- main_window : 'ElectrumWindow'
33
32
wallet : 'Abstract_Wallet'
34
33
wallet_name : str
34
+ main_window : Optional ['ElectrumWindow' ] = None
35
35
timelock_days : Optional [int ] = None
36
36
cancellation_address : Optional [str ] = None
37
37
outputs : Optional [List ['PartialTxOutput' ]] = None
@@ -48,9 +48,8 @@ class TimelockRecoveryContext:
48
48
49
49
ANCHOR_OUTPUT_AMOUNT_SATS = 600
50
50
51
- def __init__ (self , main_window : 'ElectrumWindow' ):
52
- self .main_window = main_window
53
- self .wallet = main_window .wallet
51
+ def __init__ (self , wallet : 'Abstract_Wallet' ):
52
+ self .wallet = wallet
54
53
self .wallet_name = str (self .wallet )
55
54
56
55
def _get_address_by_label (self , label : str ) -> str :
@@ -88,7 +87,7 @@ def make_unsigned_alert_tx(self, fee_est, *, confirmed_only=False) -> 'PartialTr
88
87
for output in self .outputs
89
88
]
90
89
return self .wallet .make_unsigned_transaction (
91
- coins = self .main_window . get_coins (confirmed_only = confirmed_only ),
90
+ coins = self .wallet . get_spendable_coins (confirmed_only = confirmed_only ),
92
91
outputs = self ._alert_tx_outputs ,
93
92
fee = fee_est ,
94
93
is_sweep = False ,
0 commit comments