ledger_last_hash
Comportamento
Seção intitulada “Comportamento”- Escreve o Hash de 32 bytes no write_ptr
- Recupera o hash do último ledger.
Definição
Seção intitulada “Definição”int64_t ledger_last_hash ( uint32_t write_ptr, uint32_t write_len);function ledger_last_hash(): ErrorCode | ByteArrayExemplo
Seção intitulada “Exemplo”uint8_t hash[32];int64_t bytes_written = ledger_last_hash(hash, 32);const hash = ledger_last_hash()Parâmetros
Seção intitulada “Parâmetros”| Nome | Tipo | Descrição |
|---|---|---|
| write_ptr | uint32_t | Ponteiro para um buffer de tamanho adequado para armazenar a saída. Deve ter pelo menos 32 bytes. |
| write_len | uint32_t | Tamanho do buffer de saída. |
Código de Retorno
Seção intitulada “Código de Retorno”| Tipo | Descrição |
|---|---|
| int64_t | O número de bytes escritos |
| Tipo | Descrição |
|---|---|
| number | Retorna um código de erro se ocorrer um erro, ou um array representando o hash do último ledger. |