setBackupConfirmed method

  1. @override
Future<void> setBackupConfirmed({
  1. required bool confirmed,
})
override

Set the confirmed flag. true is recorded only after an explicit confirm; false resets the gate for a fresh wallet at create-start. Must DURABLY persist before it resolves — the controller only goes deposit-ready after a true write completes, and only writes the new wallet after a false write completes (the crash-safe ordering).

Implementation

@override
Future<void> setBackupConfirmed({required bool confirmed}) async {
  setCount++;
  if (confirmed) trueSetCount++;
  lastSetValue = confirmed;
  if (holdSet != null) await holdSet!.future;
  if (failSet != null) throw failSet!;
  if (confirmed && failSetTrue != null) throw failSetTrue!;
  _confirmed = confirmed;
}