Skip to content
Snippets Groups Projects
Commit c574a7e4 authored by vjrj's avatar vjrj
Browse files

Reset consumed utxos

parent fea05ecc
No related branches found
No related tags found
No related merge requests found
...@@ -101,10 +101,8 @@ class UtxoCubit extends HydratedCubit<UtxoState> { ...@@ -101,10 +101,8 @@ class UtxoCubit extends HydratedCubit<UtxoState> {
return null; return null;
} }
// Emit a new state
emit(currentState.copyWith( emit(currentState.copyWith(
consumedUtxos: updatedConsumedUtxos, consumedUtxos: updatedConsumedUtxos,
// Update other fields if necessary
)); ));
return selectedUtxos; return selectedUtxos;
} else { } else {
...@@ -112,4 +110,13 @@ class UtxoCubit extends HydratedCubit<UtxoState> { ...@@ -112,4 +110,13 @@ class UtxoCubit extends HydratedCubit<UtxoState> {
return null; return null;
} }
} }
void resetConsumedUtxos() {
if (state is UtxoLoaded) {
// Emit a new state with an empty map for consumed UTXOs
emit((state as UtxoLoaded).copyWith(consumedUtxos: <String, Utxo>{}));
} else {
emit(UtxosError('Wrong utxo state'));
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment