Airship\Engine\Keyggdrasil::getMerkleTree PHP Method

getMerkleTree() protected method

Get the tree of existing Merkle roots.
protected getMerkleTree ( Channel $chan ) : MerkleTree
$chan Channel
return MerkleTree
    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);
    }