This change looks suspicious: it resides inside a commit named "More transaction sorting" but instead it changes wallet balance caching code, which is a quite possible spot for a vulnerability.