Browse Source

qml: sweep: allow sweep to watch-only wallet, but ask confirmation.

master
Sander van Grieken 1 year ago
parent
commit
94c54f7057
No known key found for this signature in database
GPG Key ID: 9BCF8209EA402EBA
  1. 14
      electrum/gui/qml/components/WalletMainView.qml

14
electrum/gui/qml/components/WalletMainView.qml

@ -142,6 +142,19 @@ Item {
sendButtonText: qsTr('Sweep')
})
finalizerDialog.accepted.connect(function() {
if (Daemon.currentWallet.isWatchOnly) {
var confirmdialog = app.messageDialog.createObject(mainView, {
title: qsTr('Confirm Sweep'),
text: qsTr('Current wallet is watch-only. You might not be able to spend from these addresses.\n\nAre you sure?'),
yesno: true
})
confirmdialog.accepted.connect(function() {
finalizerDialog.finalizer.send()
close()
})
confirmdialog.open()
return
}
console.log("Sending sweep transaction")
finalizerDialog.finalizer.send()
})
@ -211,7 +224,6 @@ Item {
icon.source: '../../icons/sweep.png'
action: Action {
text: qsTr('Sweep key')
enabled: !Daemon.currentWallet.isWatchOnly // watchonly might be acceptable
onTriggered: {
startSweep()
menu.deselect()

Loading…
Cancel
Save