Optimize clear_tips_{giving,receiving}

Follow-on from #2478.