CKB Pulse

Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário

Split CCC signTransaction from sendTransaction to retry on consumed inputsPráticoDe uma correção

De uma correção · Verificação: em parte certa · Verificada em 2026-11-19

When several clients race to spend the same shared cell, sign with signer.signTransaction and send with signer.client.sendTransaction as two steps instead of signer.sendTransaction. The dead-input rejection only appears at broadcast, so wrapping just the send in the retry catch lets you tell contention (re-read the live cell, rebuild, sign again) from a wallet refusal or a script verification failure, which must not be retried. Cap the attempts, because each retry costs another signature.

Porque importa: With a single sign-and-send call, a lost race for the shared cell cannot be cleanly separated from a wallet refusal. The retry loop then cannot rebuild against the new live cell.

Padrão

Preferir
return await signer.client.sendTransaction(signedTx);

Tirado do commit, encurtado.

Conceitos
Transaction building and fees, Network and RPC reliability
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-09-23
Última mudança
2026-09-23
Última verificação
2026-11-19
Verificação contra o commit
em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga

Fontes (1)

Mais sobre CCC (TypeScript SDK)

Ver as 33 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
LusoCryptoLabs, "Split CCC signTransaction from sendTransaction to retry on consumed inputs", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/split-ccc-signtransaction-from-sendtransaction-to-retry-on-c, CC BY 4.0, last changed 2026-09-23.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.