handle assert nicely

This commit is contained in:
julian 2024-08-28 10:55:27 -06:00 committed by julian-CStack
parent 99e802b59e
commit 4dc920772a

View file

@ -224,7 +224,12 @@ mixin ElectrumXInterface<T extends ElectrumXCurrencyInterface>
final utxoSigningData = await fetchBuildTxData(utxoObjectsToUse); final utxoSigningData = await fetchBuildTxData(utxoObjectsToUse);
if (isSendAll || isSendAllCoinControlUtxos) { if (isSendAll || isSendAllCoinControlUtxos) {
assert(satoshiAmountToSend == satoshisBeingUsed); if (satoshiAmountToSend != satoshisBeingUsed) {
throw Exception(
"Something happened that should never actually happen. "
"Please report this error to the developers.",
);
}
return await _sendAllBuilder( return await _sendAllBuilder(
txData: txData, txData: txData,
recipientAddress: recipientAddress, recipientAddress: recipientAddress,