Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Clear the CCC client cache after a sent transaction loses a double spend racePráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
A CCC client caches the outputs of every transaction it sent, so when that transaction loses a race for the same input and never commits, its change cells still look usable to later builds. This campaign calls client.cache.clear() on every client before rebuilding and confirms candidate cells with getCellLiveNoCache rather than trusting cached state.
Porque importa: Without clearing, the losing client's cache still lists that transaction's change outputs as spendable and its inputs as spent, so rebuilds pick cells that do not exist on chain and the node rejects them.
Padrão
for(const c of clients)await c.cache.clear();Tirado do commit, encurtado.
- Conceitos
- Indexer queries and cell collection, Transaction building and fees
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-29
- Última mudança
- 2026-10-29
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-10-29 · toastmanAu/openswap · mais deste projeto
Mais sobre CCC (TypeScript SDK)
- Deriving minimum cell capacity with ccc.CellOutput.from and output data
- Parsing snake_case JSON-RPC transactions in CCC
- Reserve co-signer witness space before completeFeeBy in multi-signer CCC transactions
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Clear the CCC client cache after a sent transaction loses a double spend race", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/clear-the-ccc-client-cache-after-a-sent-transaction-loses-a, CC BY 4.0, last changed 2026-10-29.