Merge pull request #184 from UdjinM6/v0.11.2.x_fix_qt_multiple_recipients

(v0.11.2.x) qt bug multiple recipients are wrongly send as IX
This commit is contained in:
evan82 2015-02-16 12:49:09 -07:00
commit e3df2faa74

View File

@ -303,10 +303,10 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
{
LOCK2(cs_main, wallet->cs_wallet);
CWalletTx *newTx = transaction.getTransaction();
QList<SendCoinsRecipient> recipients = transaction.getRecipients();
// Store PaymentRequests in wtx.vOrderForm in wallet.
std::string strCommand = "tx";
foreach(const SendCoinsRecipient &rcp, transaction.getRecipients())
foreach(const SendCoinsRecipient &rcp, recipients)
{
if (rcp.paymentRequest.IsInitialized())
{
@ -319,18 +319,13 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
{
newTx->vOrderForm.push_back(make_pair("Message", rcp.message.toStdString()));
}
if(rcp.useInstantX) {
strCommand = "txlreq";
}
}
CReserveKey *keyChange = transaction.getPossibleKeyChange();
transaction.getRecipients();
if(!wallet->CommitTransaction(*newTx, *keyChange, strCommand))
if(!wallet->CommitTransaction(*newTx, *keyChange, (recipients[0].useInstantX) ? "txlreq" : "tx"))
return TransactionCommitFailed;
CTransaction* t = (CTransaction*)newTx;