Airship\Cabin\Bridge\Blueprint\ChannelUpdates::getKeyUpdates PHP 메소드

getKeyUpdates() 보호된 메소드

Get key updates from the channel
protected getKeyUpdates ( MerkleTree $tree ) : array
$tree MerkleTree
리턴 array
    protected function getKeyUpdates(MerkleTree $tree) : array
    {
        $newNodes = [];
        foreach ($this->getChannelUpdates($tree->getRoot()) as $new) {
            $newNode = new Node($new['data']);
            $tree = $tree->getExpandedTree($newNode);
            // Verify that we've calculated the same Merkle root for each new leaf:
            if (\hash_equals($new['root'], $tree->getRoot())) {
                // Attempt to store the update (and create/revoke copies of the public keys):
                if ($this->storeUpdate($new)) {
                    $newNodes[] = $newNode;
                }
            }
        }
        if (\count($newNodes) > 0) {
            $this->notifyPeersOfNewUpdate();
        }
        return $newNodes;
    }