use AvailableCoinsType instead of string in walletmodel

This commit is contained in:
UdjinM6 2015-02-08 17:00:23 +03:00
parent ddc31b0ff7
commit 562b844819
3 changed files with 6 additions and 15 deletions

View File

@ -144,10 +144,10 @@ void SendCoinsDialog::on_sendButton_clicked()
QString strFunds = "using <b>anonymous funds</b>";
QString strFee = "";
recipients[0].inputType = "ONLY_DENOMINATED";
recipients[0].inputType = ONLY_DENOMINATED;
if(ui->checkUseDarksend->isChecked()) {
recipients[0].inputType = "ONLY_DENOMINATED";
recipients[0].inputType = ONLY_DENOMINATED;
strFunds = "using <b>anonymous funds</b>";
QString strNearestAmount(
BitcoinUnits::formatWithUnit(
@ -156,7 +156,7 @@ void SendCoinsDialog::on_sendButton_clicked()
"(darksend requires this amount to be rounded up to the nearest %1)."
).arg(strNearestAmount));
} else {
recipients[0].inputType = "ALL_COINS";
recipients[0].inputType = ALL_COINS;
strFunds = "using <b>any available funds (not recommended)</b>";
}

View File

@ -266,17 +266,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
CWalletTx *newTx = transaction.getTransaction();
CReserveKey *keyChange = transaction.getPossibleKeyChange();
AvailableCoinsType act = ONLY_DENOMINATED;
if(recipients[0].inputType == "ONLY_NONDENOMINATED"){
act = ONLY_NONDENOMINATED;
} else if(recipients[0].inputType == "ONLY_DENOMINATED"){
act = ONLY_DENOMINATED;
} else if(recipients[0].inputType == "ALL_COINS"){
act = ALL_COINS;
}
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, strFailReason, coinControl, act, recipients[0].useInstantX);
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, strFailReason, coinControl, recipients[0].inputType, recipients[0].useInstantX);
transaction.setTransactionFee(nFeeRequired);
if(!fCreated)

View File

@ -10,6 +10,7 @@
#include "allocators.h" /* for SecureString */
#include "instantx.h"
#include "wallet.h"
#include <map>
#include <vector>
@ -49,7 +50,7 @@ public:
QString address;
QString label;
qint64 amount;
std::string inputType;
AvailableCoinsType inputType;
bool useInstantX;
// If from a payment request, this is used for storing the memo
QString message;