All lessons · Light client · Start here · Glossary
Light client set_scripts "all" replaces the whole registered script setWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
The CKB light client's set_scripts with the all command replaces every registered script, so a call carrying only one wallet's lock script unregisters all other wallets. When several scripts must stay tracked, either pass the full set with each script's own start block, or use the partial command to update only the changed script. If registrations can race, serialise them so a stale full set cannot overwrite a newer one.
Why it matters: Re-registering one wallet with the all command after a sync mode change silently stopped syncing every other wallet in the app.
Pattern
setScriptsAndRecord(scriptStatuses + ..., listOf(activeWalletId) + ..., LightClientNative.CMD_SET_SCRIPTS_ALL)Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- RaheemJnr/pocket-node:
android/app/src/test/java/com/rjnr/pocketnode/data/gateway/GatewayRepositoryResyncStrategyTest.kt,android/app/src/test/java/com/rjnr/pocketnode/data/gateway/TestGatewayRepository.kt,android/app/src/test/java/com/rjnr/pocketnode/data/wallet/WalletRepositoryTest.kt,android/app/src/test/java/com/rjnr/pocketnode/ui/screens/onboarding/MnemonicImportViewModelSyncTest.kt,android/app/src/test/java/com/rjnr/pocketnode/ui/screens/wallet/AddWalletViewModelImportSyncTest.kt
- Concepts
- Indexer queries and cell collection, Network and RPC reliability
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-09-30
- Last changed
- 2026-09-30
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-09-30 · RaheemJnr/pocket-node · more from this project
More about Light client
- Give light clients the committing block of a cell, not just its outpoint
- Light client still reports a removed script until the new script set lands
- Light client sync progress poll racing set_scripts
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Light client set_scripts "all" replaces the whole registered script set", CKB lessons, https://pulse.lusocryptolabs.com/learned/light-client/light-client-set-scripts-all-replaces-the-whole-registered-s, CC BY 4.0, last changed 2026-09-30.