protected function getMerkleTree(Channel $chan) : MerkleTree
{
$nodeList = [];
$nodes = $this->db->run('SELECT
data
FROM
airship_tree_updates
WHERE
channel = ?
ORDER BY
treeupdateid ASC
', $chan->getName());
foreach ($nodes as $node) {
$nodeList[] = new Node($node['data']);
}
return (new MerkleTree(...$nodeList))->setHashSize(\Sodium\CRYPTO_GENERICHASH_BYTES_MAX)->setPersonalizationString(\AIRSHIP_BLAKE2B_PERSONALIZATION);
}