Skip to content

Kotlin shielded Clear re-registers other wallets with account [0], replacing their account lists #5989

Done

Description

@llbartekll

Expected Behavior

After a shielded Clear on Android, every wallet is registered again with the accounts it had before, and a bind that started after the Clear is not replaced.

Current Behavior

ShieldedService.clearLocalState re-binds the mirror wallet and then calls engineBindOtherWallets, which runs bindEngine(mgr, other.walletId, dbPath) for every other loaded wallet. bindEngine defaults accounts to listOf(0), so:

  • a wallet that is not the mirror and was bound with other accounts comes back registered with [0];
  • the mirror wallet is read once before the pass, so a wallet that becomes the mirror and binds, say, [1] after that read can be registered with [0] afterwards. Rust replaces the account set while the service still reports [1].

The same pass is on v5.1-dev.

Possible Solution

Have the wallet coordinator restore the registrations a Clear dropped, or keep each wallet's bound account list in the service and skip a wallet whose bind began after the Clear.

Steps to Reproduce (for bugs)

  1. Load two wallets, A (the mirror) and B, and bind B with accounts other than [0].
  2. Run Clear from A.
  3. B is registered again with [0].

Found in review of #5982 and confirmed by reading packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/services/ShieldedService.kt. Not reproduced on a device.

Context

Deferred from #5982: #5982 (comment). The behaviour does not depend on how the shielded balance is delivered, so it was left out of that pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatform-wallet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions