CreateTransaction: return strFailReason on failure

This commit is contained in:
Gavin Andresen
2013-04-25 17:31:22 -04:00
parent 8de9bb53af
commit 1f00f4e9c9
4 changed files with 37 additions and 17 deletions

View File

@@ -181,7 +181,8 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
CWalletTx wtx;
CReserveKey keyChange(wallet);
int64 nFeeRequired = 0;
bool fCreated = wallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
std::string strFailReason;
bool fCreated = wallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, strFailReason);
if(!fCreated)
{
@@ -189,6 +190,8 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
{
return SendCoinsReturn(AmountWithFeeExceedsBalance, nFeeRequired);
}
emit message(tr("Send Coins"), QString::fromStdString(strFailReason),
CClientUIInterface::MSG_ERROR);
return TransactionCreationFailed;
}
if(!uiInterface.ThreadSafeAskFee(nFeeRequired))