Merge pull request #597

9c4c34d Use new fee multipliers after v5 fork requires #1915 (Jaquee)
f05f0b7 add WalletManager::useForkRules() (Jaquee)
This commit is contained in:
Riccardo Spagni 2017-03-25 17:39:07 +02:00
commit b3877868a3
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 35 additions and 1 deletions

View file

@ -286,6 +286,9 @@ ApplicationWindow {
leftPanel.networkStatus.connected = status
leftPanel.progressBar.visible = (status === Wallet.ConnectionStatus_Connected) && !daemonSynced
// Update fee multiplier dropdown on transfer page
middlePanel.transferView.updatePriorityDropdown();
// If wallet isnt connected and no daemon is running - Ask
if(!walletInitialized && status === Wallet.ConnectionStatus_Disconnected && !daemonManager.running(persistentSettings.testnet)){
daemonManagerDialog.open();

View file

@ -195,6 +195,17 @@ Rectangle {
ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: PendingTransaction.Priority_High }
}
// Priorites after v5
ListModel {
id: priorityModelV5
ListElement { column1: qsTr("Low (x1 fee)") ; column2: ""; priority: 1}
ListElement { column1: qsTr("Default (x4 fee)") ; column2: ""; priority: 2 }
ListElement { column1: qsTr("Medium (x20 fee)") ; column2: ""; priority: 3 }
ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: 4 }
}
StandardDropdown {
id: priorityDropdown
anchors.top: transactionPriority.bottom
@ -206,7 +217,6 @@ Rectangle {
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
dataModel: priorityModel
z: 1
}
@ -700,6 +710,19 @@ Rectangle {
console.log("transfer page loaded")
updateStatus();
updateMixin();
updatePriorityDropdown()
}
function updatePriorityDropdown() {
// Use new fee multipliers after v5 fork
if (typeof currentWallet != "undefined" && currentWallet.useForkRules(5)) {
priorityDropdown.dataModel = priorityModelV5;
priorityDropdown.currentIndex = 1
} else {
priorityDropdown.dataModel = priorityModel;
priorityDropdown.currentIndex = 0
}
}
//TODO: Add daemon sync status

View file

@ -587,6 +587,11 @@ bool Wallet::rescanSpent()
return m_walletImpl->rescanSpent();
}
bool Wallet::useForkRules(quint8 required_version, quint64 earlyBlocks) const
{
return m_walletImpl->useForkRules(required_version,earlyBlocks);
}
Wallet::Wallet(Monero::Wallet *w, QObject *parent)
: QObject(parent)
, m_walletImpl(w)

View file

@ -228,6 +228,9 @@ public:
// Rescan spent outputs
Q_INVOKABLE bool rescanSpent();
// check if fork rules should be used
Q_INVOKABLE bool useForkRules(quint8 version, quint64 earlyBlocks) const;
// TODO: setListenter() when it implemented in API
signals:
// emitted on every event happened with wallet