We do this by adding callbacks for when a node is added or deleted from the keytable. dns_keytable_add and dns_keytable_delete where extended to take a callback. dns_keytable_deletekey does not remove the node so it was not extended.