CKB Pulse

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

Indexer get_cells order is by script args, not by cell agePráticoDe uma correção

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

Cells returned by a prefix search on type script args (as findRounds does here) come back in indexer key order, sorted by type args, not by creation time, so taking the first result does not give the newest cell. To get the latest, sort by a field stored in the cell (here the round config's entryStart).

Porque importa: Taking the first cell of a prefix search picks whichever cell has the smallest script args, not the newest one. Here that was a dead round, so the entry and refund pages could not reach the live round or the round with pending refunds.

Padrão

Evitar
const round = rounds[0];

Tirado do commit, encurtado.

Um teste mudou no mesmo commit

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

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

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, "Indexer get_cells order is by script args, not by cell age", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/indexer-get-cells-order-is-by-script-args-not-by-cell-age, CC BY 4.0, last changed 2026-11-09.

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.