Recently I've done some researches in term of how BP earning reward functions implemented. Eventually, I found out that is system_contract::claimrewards however I can't find where it's called. I searched whole project and could not find which function calls it. Could some one please help!
This link may be helpful. Good luck! https://steemit.com/blockchain/@eosiosg/system-contract-part-1-block-producer-rewards