mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-19 16:13:55 +02:00
Add segregation key reuse mitigation options
This commit is contained in:
parent
65ea07af61
commit
22a1114501
3
main.qml
3
main.qml
@ -1003,6 +1003,9 @@ ApplicationWindow {
|
|||||||
property bool useRemoteNode: false
|
property bool useRemoteNode: false
|
||||||
property string remoteNodeAddress: ""
|
property string remoteNodeAddress: ""
|
||||||
property string bootstrapNodeAddress: ""
|
property string bootstrapNodeAddress: ""
|
||||||
|
property bool segregatePreForkOutputs: true
|
||||||
|
property bool keyReuseMitigation2: true
|
||||||
|
property int segregationHeight: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information dialog
|
// Information dialog
|
||||||
|
@ -355,10 +355,66 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckBox {
|
||||||
|
id: segregatePreForkOutputs
|
||||||
|
checked: persistentSettings.segregatePreForkOutputs
|
||||||
|
text: qsTr("I intend to spend on key-reusing fork(s)") + translationManager.emptyString
|
||||||
|
checkedIcon: "../images/checkedVioletIcon.png"
|
||||||
|
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||||
|
onClicked: {
|
||||||
|
persistentSettings.segregatePreForkOutputs = segregatePreForkOutputs.checked
|
||||||
|
if (appWindow.currentWallet) {
|
||||||
|
appWindow.currentWallet.segregatePreForkOutputs(segregatePreForkOutputs.checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckBox {
|
||||||
|
id: keyReuseMitigation2
|
||||||
|
checked: persistentSettings.keyReuseMitigation2
|
||||||
|
text: qsTr("I might want to spend on key-reusing fork(s)") + translationManager.emptyString
|
||||||
|
checkedIcon: "../images/checkedVioletIcon.png"
|
||||||
|
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||||
|
onClicked: {
|
||||||
|
persistentSettings.keyReuseMitigation2 = keyReuseMitigation2.checked
|
||||||
|
if (appWindow.currentWallet) {
|
||||||
|
appWindow.currentWallet.keyReuseMitigation2(keyReuseMitigation2.checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
id: segregationHeightRow
|
||||||
|
anchors.topMargin: 17
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: segregationHeightLabel
|
||||||
|
fontSize: 14
|
||||||
|
text: qsTr("Segregation height:") + translationManager.emptyString
|
||||||
|
}
|
||||||
|
LineEdit {
|
||||||
|
id: segregationHeightLine
|
||||||
|
readOnly: false
|
||||||
|
Layout.fillWidth: true
|
||||||
|
validator: IntValidator { bottom: 0 }
|
||||||
|
onEditingFinished: {
|
||||||
|
persistentSettings.segregationHeight = segregationHeightLine.text
|
||||||
|
if (appWindow.currentWallet) {
|
||||||
|
appWindow.currentWallet.segregationHeight(segregationHeightLine.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPageCompleted() {
|
function onPageCompleted() {
|
||||||
console.log("RingDB page loaded");
|
console.log("RingDB page loaded");
|
||||||
|
appWindow.currentWallet.segregatePreForkOutputs(persistentSettings.segregatePreForkOutputs)
|
||||||
|
appWindow.currentWallet.segregationHeight(persistentSettings.segregationHeight)
|
||||||
|
segregationHeightLine.text = persistentSettings.segregationHeight
|
||||||
|
appWindow.currentWallet.keyReuseMitigation2(persistentSettings.keyReuseMitigation2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -829,6 +829,21 @@ bool Wallet::setRing(const QString &key_image, const QString &ring, bool relativ
|
|||||||
return m_walletImpl->setRing(key_image.toStdString(), cring, relative);
|
return m_walletImpl->setRing(key_image.toStdString(), cring, relative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Wallet::segregatePreForkOutputs(bool segregate)
|
||||||
|
{
|
||||||
|
m_walletImpl->segregatePreForkOutputs(segregate);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Wallet::segregationHeight(quint64 height)
|
||||||
|
{
|
||||||
|
m_walletImpl->segregationHeight(height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Wallet::keyReuseMitigation2(bool mitigation)
|
||||||
|
{
|
||||||
|
m_walletImpl->keyReuseMitigation2(mitigation);
|
||||||
|
}
|
||||||
|
|
||||||
Wallet::Wallet(Monero::Wallet *w, QObject *parent)
|
Wallet::Wallet(Monero::Wallet *w, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_walletImpl(w)
|
, m_walletImpl(w)
|
||||||
|
@ -288,6 +288,11 @@ public:
|
|||||||
Q_INVOKABLE QString getRings(const QString &txid);
|
Q_INVOKABLE QString getRings(const QString &txid);
|
||||||
Q_INVOKABLE bool setRing(const QString &key_image, const QString &ring, bool relative);
|
Q_INVOKABLE bool setRing(const QString &key_image, const QString &ring, bool relative);
|
||||||
|
|
||||||
|
// key reuse mitigation options
|
||||||
|
Q_INVOKABLE void segregatePreForkOutputs(bool segregate);
|
||||||
|
Q_INVOKABLE void segregationHeight(quint64 height);
|
||||||
|
Q_INVOKABLE void keyReuseMitigation2(bool mitigation);
|
||||||
|
|
||||||
// TODO: setListenter() when it implemented in API
|
// TODO: setListenter() when it implemented in API
|
||||||
signals:
|
signals:
|
||||||
// emitted on every event happened with wallet
|
// emitted on every event happened with wallet
|
||||||
|
Loading…
Reference in New Issue
Block a user