1
0

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

This commit is contained in:
Sander van Grieken
2024-10-09 17:45:40 +02:00
parent 48527b1501
commit 94c54f7057

View File

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