ledger_last_hash
Behaviour
Section titled “Behaviour”- Write the 32 byte Hash to the write_ptr
- Retrieves the hash of the last ledger.
Definition
Section titled “Definition”int64_t ledger_last_hash ( uint32_t write_ptr, uint32_t write_len);
function ledger_last_hash(): ErrorCode | ByteArray
Example
Section titled “Example”uint8_t hash[32];int64_t bytes_written = ledger_last_hash(hash, 32);
const hash = ledger_last_hash()
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
write_ptr | uint32_t | Pointer to a buffer of a suitable size to store the output. Should be at least 32 bytes. |
write_len | uint32_t | Length of the output buffer. |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The number of bytes written |
Type | Description |
---|---|
number | Returns an error code if an error occurs, or an array representing the hash of the last ledger. |