It offers the compensation as all woes vanish in recollection of the "dear friend." The narrator talks as if the joy of the dear friend wipes out all the pain of remembrance.
The idea that recalling a dear friend brings an end to all troubles suggests that the narrator finds emotional solace in remembering happy times with their loved one, which outweighs any negative emotions associated with remembrance.