From 73829bd97f070f8264ab9a98a8a68a3a21be1ec4 Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Wed, 23 Oct 2019 11:56:38 +0530 Subject: [PATCH] Fixed GPOS vesting factor issue when proxy is set --- libraries/chain/db_maint.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index 81fce8f9..182c04fc 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -727,9 +727,13 @@ void deprecate_annual_members( database& db ) double database::calculate_vesting_factor(const account_object& stake_account) { - // get last time voted form stats - const auto &stats = stake_account.statistics(*this); - fc::time_point_sec last_date_voted = stats.last_vote_time; + fc::time_point_sec last_date_voted; + // get last time voted form account stats + // check last_vote_time of proxy voting account if proxy is set + if (stake_account.options.voting_account == GRAPHENE_PROXY_TO_SELF_ACCOUNT) + last_date_voted = stake_account.statistics(*this).last_vote_time; + else + last_date_voted = stake_account.options.voting_account(*this).statistics(*this).last_vote_time; // get global data related to gpos const auto &gpo = this->get_global_properties();