commit
ce0617fb4b
|
@ -69,7 +69,7 @@ wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii --na
|
||||||
|
|
||||||
# set timestamps in dist, in order to make the installer reproducible
|
# set timestamps in dist, in order to make the installer reproducible
|
||||||
pushd dist
|
pushd dist
|
||||||
find -type f -exec touch -d '2000-01-1 18:00:16' {} +
|
find -type f -exec touch -d '2000-11-11T11:11:11+00:00' {} +
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# build NSIS installer
|
# build NSIS installer
|
||||||
|
|
|
@ -15,7 +15,7 @@ $here/prepare-hw.sh || exit 1
|
||||||
echo "Resetting modification time in C:\Python..."
|
echo "Resetting modification time in C:\Python..."
|
||||||
# (Because of some bugs in pyinstaller)
|
# (Because of some bugs in pyinstaller)
|
||||||
pushd /opt/wine64/drive_c/python*
|
pushd /opt/wine64/drive_c/python*
|
||||||
find -type f -exec touch -d '2000-11-11 11:11:11' {} +
|
find -type f -exec touch -d '2000-11-11T11:11:11+00:00' {} +
|
||||||
popd
|
popd
|
||||||
ls -l /opt/wine64/drive_c/python*
|
ls -l /opt/wine64/drive_c/python*
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
self.require_fee_update = False
|
self.require_fee_update = False
|
||||||
self.tx_notifications = []
|
self.tx_notifications = []
|
||||||
self.tl_windows = []
|
self.tl_windows = []
|
||||||
|
self.tx_external_keypairs = {}
|
||||||
|
|
||||||
self.create_status_bar()
|
self.create_status_bar()
|
||||||
self.need_update = threading.Event()
|
self.need_update = threading.Event()
|
||||||
|
@ -1414,6 +1415,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
self.on_error(exc_info)
|
self.on_error(exc_info)
|
||||||
callback(False)
|
callback(False)
|
||||||
|
|
||||||
|
if self.tx_external_keypairs:
|
||||||
|
task = partial(Transaction.sign, tx, self.tx_external_keypairs)
|
||||||
|
else:
|
||||||
task = partial(self.wallet.sign_transaction, tx, password)
|
task = partial(self.wallet.sign_transaction, tx, password)
|
||||||
WaitingDialog(self, _('Signing transaction...'), task,
|
WaitingDialog(self, _('Signing transaction...'), task,
|
||||||
on_signed, on_failed)
|
on_signed, on_failed)
|
||||||
|
@ -1557,6 +1561,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
e.setFrozen(False)
|
e.setFrozen(False)
|
||||||
self.set_pay_from([])
|
self.set_pay_from([])
|
||||||
self.rbf_checkbox.setChecked(False)
|
self.rbf_checkbox.setChecked(False)
|
||||||
|
self.tx_external_keypairs = {}
|
||||||
self.update_status()
|
self.update_status()
|
||||||
run_hook('do_clear', self)
|
run_hook('do_clear', self)
|
||||||
|
|
||||||
|
@ -2364,14 +2369,20 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
address_e.textChanged.connect(on_address)
|
address_e.textChanged.connect(on_address)
|
||||||
if not d.exec_():
|
if not d.exec_():
|
||||||
return
|
return
|
||||||
from electrum.wallet import sweep
|
from electrum.wallet import sweep_preparations
|
||||||
try:
|
try:
|
||||||
tx = sweep(get_pk(), self.network, self.config, get_address(), None)
|
self.do_clear()
|
||||||
|
coins, keypairs = sweep_preparations(get_pk(), self.network)
|
||||||
|
self.tx_external_keypairs = keypairs
|
||||||
|
self.spend_coins(coins)
|
||||||
|
self.payto_e.setText(get_address())
|
||||||
|
self.spend_max()
|
||||||
|
self.payto_e.setFrozen(True)
|
||||||
|
self.amount_e.setFrozen(True)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.show_message(str(e))
|
self.show_message(str(e))
|
||||||
return
|
return
|
||||||
self.warn_if_watching_only()
|
self.warn_if_watching_only()
|
||||||
self.show_transaction(tx)
|
|
||||||
|
|
||||||
def _do_import(self, title, msg, func):
|
def _do_import(self, title, msg, func):
|
||||||
text = text_dialog(self, title, msg + ' :', _('Import'))
|
text = text_dialog(self, title, msg + ' :', _('Import'))
|
||||||
|
|
|
@ -178,7 +178,9 @@ class TxDialog(QDialog, MessageBoxMixin):
|
||||||
tx_hash, status, label, can_broadcast, can_rbf, amount, fee, height, conf, timestamp, exp_n = self.wallet.get_tx_info(self.tx)
|
tx_hash, status, label, can_broadcast, can_rbf, amount, fee, height, conf, timestamp, exp_n = self.wallet.get_tx_info(self.tx)
|
||||||
size = self.tx.estimated_size()
|
size = self.tx.estimated_size()
|
||||||
self.broadcast_button.setEnabled(can_broadcast)
|
self.broadcast_button.setEnabled(can_broadcast)
|
||||||
self.sign_button.setEnabled(self.wallet.can_sign(self.tx))
|
can_sign = not self.tx.is_complete() and \
|
||||||
|
(self.wallet.can_sign(self.tx) or bool(self.main_window.tx_external_keypairs))
|
||||||
|
self.sign_button.setEnabled(can_sign)
|
||||||
self.tx_hash_e.setText(tx_hash or _('Unknown'))
|
self.tx_hash_e.setText(tx_hash or _('Unknown'))
|
||||||
if desc is None:
|
if desc is None:
|
||||||
self.tx_desc.hide()
|
self.tx_desc.hide()
|
||||||
|
|
|
@ -526,7 +526,7 @@ class RSAKey(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def generate(bits):
|
def generate(bits):
|
||||||
key = Python_RSAKey()
|
key = RSAKey()
|
||||||
p = getRandomPrime(bits//2, False)
|
p = getRandomPrime(bits//2, False)
|
||||||
q = getRandomPrime(bits//2, False)
|
q = getRandomPrime(bits//2, False)
|
||||||
t = lcm(p-1, q-1)
|
t = lcm(p-1, q-1)
|
||||||
|
@ -540,4 +540,3 @@ class RSAKey(object):
|
||||||
key.qInv = invMod(q, p)
|
key.qInv = invMod(q, p)
|
||||||
return key
|
return key
|
||||||
generate = staticmethod(generate)
|
generate = staticmethod(generate)
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ def append_utxos_to_inputs(inputs, network, pubkey, txin_type, imax):
|
||||||
item['num_sig'] = 1
|
item['num_sig'] = 1
|
||||||
inputs.append(item)
|
inputs.append(item)
|
||||||
|
|
||||||
def sweep(privkeys, network, config, recipient, fee=None, imax=100):
|
def sweep_preparations(privkeys, network, imax=100):
|
||||||
|
|
||||||
def find_utxos_for_privkey(txin_type, privkey, compressed):
|
def find_utxos_for_privkey(txin_type, privkey, compressed):
|
||||||
pubkey = bitcoin.public_key_from_private_key(privkey, compressed)
|
pubkey = bitcoin.public_key_from_private_key(privkey, compressed)
|
||||||
|
@ -123,6 +123,11 @@ def sweep(privkeys, network, config, recipient, fee=None, imax=100):
|
||||||
find_utxos_for_privkey('p2pk', privkey, compressed)
|
find_utxos_for_privkey('p2pk', privkey, compressed)
|
||||||
if not inputs:
|
if not inputs:
|
||||||
raise BaseException(_('No inputs found. (Note that inputs need to be confirmed)'))
|
raise BaseException(_('No inputs found. (Note that inputs need to be confirmed)'))
|
||||||
|
return inputs, keypairs
|
||||||
|
|
||||||
|
|
||||||
|
def sweep(privkeys, network, config, recipient, fee=None, imax=100):
|
||||||
|
inputs, keypairs = sweep_preparations(privkeys, network, imax)
|
||||||
total = sum(i.get('value') for i in inputs)
|
total = sum(i.get('value') for i in inputs)
|
||||||
if fee is None:
|
if fee is None:
|
||||||
outputs = [(TYPE_ADDRESS, recipient, total)]
|
outputs = [(TYPE_ADDRESS, recipient, total)]
|
||||||
|
|
Loading…
Reference in New Issue