CKB Pulse

Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário

Computing cell confirmations from get_transaction block_hash and tip headerPráticoDe uma correção

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

To get a cell's confirmation count over raw CKB JSON-RPC, read tx_status.block_hash from get_transaction, look up its number with get_header, then compute tip − included + 1 using get_tip_header; treat a missing block_hash as 0 confirmations. This commit's helper also retries get_transaction without the "0x2" verbosity param if the node rejects it, and treats get_live_cell as live only when status === "live".

Porque importa: Without a confirmation count, a verifier that enforces a minimum confirmation threshold (here MIN_CAPABILITY_CONFIRMATIONS) can neither apply it nor report finality metadata for a just-included or pending capability cell.

Padrão

Preferir
confirmations: tip >= included ? Number(tip - included + 1n) : 0,

Tirado do commit, encurtado.

Um teste mudou no mesmo commit

Está ao lado da correcção. Nós não o corremos.

Conceitos
Network and RPC reliability, Indexer queries and cell collection
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-09-22
Última mudança
2026-09-22
Ú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 CKB node, RPC and indexer

Ver as 45 deste tema

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

Citar esta lição
LusoCryptoLabs, "Computing cell confirmations from get_transaction block_hash and tip header", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/computing-cell-confirmations-from-get-transaction-block-hash, CC BY 4.0, last changed 2026-09-22.

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.