mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-31 07:51:23 +02:00
gui: create tx, launch error dialog if backend throws runtime_error
only will ever happen if something unexpected happened.
This commit is contained in:
@@ -212,7 +212,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
|||||||
return AmountExceedsBalance;
|
return AmountExceedsBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
try {
|
||||||
CAmount nFeeRequired = 0;
|
CAmount nFeeRequired = 0;
|
||||||
int nChangePosRet = -1;
|
int nChangePosRet = -1;
|
||||||
|
|
||||||
@@ -240,6 +240,11 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
|||||||
if (nFeeRequired > m_wallet->getDefaultMaxTxFee()) {
|
if (nFeeRequired > m_wallet->getDefaultMaxTxFee()) {
|
||||||
return AbsurdFee;
|
return AbsurdFee;
|
||||||
}
|
}
|
||||||
|
} catch (const std::runtime_error& err) {
|
||||||
|
// Something unexpected happened, instruct user to report this bug.
|
||||||
|
Q_EMIT message(tr("Send Coins"), QString::fromStdString(err.what()),
|
||||||
|
CClientUIInterface::MSG_ERROR);
|
||||||
|
return TransactionCreationFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SendCoinsReturn(OK);
|
return SendCoinsReturn(OK);
|
||||||
|
Reference in New Issue
Block a user