---
name: "mtree_verify"
section: "3"
platform: "linux"
package: "liblibrecast-dev"
version: "0.9.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mtree_verify"
---

# mtree\_verify(3)

validate a merkle tree

## NAME

mtree\_verify - validate a merkle tree

## LIBRARY

Librecast library (*liblibrecast*, *-llibrecast*)

## SYNOPSIS

```
#include <librecast/mtree.h>
```

**int mtree\_verify(mtree\_t** *\*tree***);**

Compile and link with *-llibrecast*.

## DESCRIPTION

The **mtree\_verify** function re-hashes the nodes in *tree* from the base to the root, returning zero if the tree is valid.

## RETURN VALUE

**mtree\_verify**() returns zero if the tree is valid, -1 if not.

## ERRORS

None.

## SEE ALSO

[**mtree\_init**(3)](/mtree_init/3.md), [**mtree\_free**(3)](/mtree_free/3.md), [**q\_init**(3)](/q_init/3.md), [**q\_pool\_create**(3)](/q_pool_create/3.md), [**q\_job\_seek**(3)](/q_job_seek/3.md)
