mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
manual cherry picking part 2
This commit is contained in:
parent
be66c71154
commit
d29e4e97e2
1 changed files with 14 additions and 0 deletions
|
@ -696,6 +696,10 @@ mixin CashFusion on CoinControl, ElectrumX {
|
|||
|
||||
// Fuse UTXOs.
|
||||
try {
|
||||
if (coinList.isEmpty) {
|
||||
throw Exception("Started with no coins");
|
||||
}
|
||||
|
||||
await _mainFusionObject!.fuse(
|
||||
inputsFromWallet: coinList,
|
||||
network: cryptoCurrency.networkParams,
|
||||
|
@ -723,6 +727,16 @@ mixin CashFusion on CoinControl, ElectrumX {
|
|||
// Do the same for the UI state.
|
||||
_uiState?.incrementFusionRoundsFailed();
|
||||
|
||||
// If we have no coins, stop trying.
|
||||
if (coinList.isEmpty ||
|
||||
e.toString().contains("Started with no coins")) {
|
||||
_updateStatus(
|
||||
status: fusion.FusionStatus.failed,
|
||||
info: "Started with no coins, stopping.");
|
||||
_stopRequested = true;
|
||||
_uiState?.setFailed(true, shouldNotify: true);
|
||||
}
|
||||
|
||||
// If we fail too many times in a row, stop trying.
|
||||
if (_failedFuseCount >= maxFailedFuseCount) {
|
||||
_updateStatus(
|
||||
|
|
Loading…
Reference in a new issue