“Let the righteous rejoice in Yahweh!
Take refuge in Yahweh!
Let all the upright in heart glory!”
This psalm ends with the righteous rejoicing in Yahweh, the God of Israel. They have taken refuge in Yahweh. The upright of heart can now glory in Yahweh. Thus we have a happy ending to the complaints about the wicked enemies. God has justified the righteous. Once again, they can be self-righteous.