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

View File

@ -266,17 +266,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
CWalletTx *newTx = transaction.getTransaction(); CWalletTx *newTx = transaction.getTransaction();
CReserveKey *keyChange = transaction.getPossibleKeyChange(); CReserveKey *keyChange = transaction.getPossibleKeyChange();
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, strFailReason, coinControl, recipients[0].inputType, recipients[0].useInstantX);
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);
transaction.setTransactionFee(nFeeRequired); transaction.setTransactionFee(nFeeRequired);
if(!fCreated) if(!fCreated)

View File

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