add peerstats compution and clean up stat calculation in rewards