diff --git a/src/gridcoin/voting/registry.cpp b/src/gridcoin/voting/registry.cpp index 9c3a7468e9..662bd97848 100644 --- a/src/gridcoin/voting/registry.cpp +++ b/src/gridcoin/voting/registry.cpp @@ -1046,6 +1046,9 @@ void PollRegistry::AddVote(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIRED( *poll_ref->m_ptitle, poll_ref->Votes().size()); + if (fQtActive && !poll_ref->Expired(GetAdjustedTime())) { + uiInterface.NewVoteReceived(ctx.m_tx.GetHash()); + } } } @@ -1068,6 +1071,10 @@ void PollRegistry::AddVote(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIRED( return; } poll_ref->LinkVote(ctx.m_tx.GetHash()); + + if (fQtActive && !poll_ref->Expired(GetAdjustedTime())) { + uiInterface.NewVoteReceived(ctx.m_tx.GetHash()); + } } } @@ -1075,6 +1082,8 @@ void PollRegistry::DeletePoll(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIR { const auto payload = ctx->SharePayloadAs(); + int64_t poll_time = payload->m_poll.m_timestamp; + m_polls.erase(ToLower(payload->m_poll.m_title)); m_polls_by_txid.erase(ctx.m_tx.GetHash()); @@ -1085,6 +1094,10 @@ void PollRegistry::DeletePoll(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIR payload->m_poll.m_title, m_polls.size()); + if (fQtActive) { + uiInterface.NewPollReceived(poll_time);; + } + } void PollRegistry::DeleteVote(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIRED(cs_main, PollRegistry::cs_poll_registry) @@ -1100,6 +1113,10 @@ void PollRegistry::DeleteVote(const ContractContext& ctx) EXCLUSIVE_LOCKS_REQUIR ctx.m_tx.GetHash().GetHex(), *poll_ref->m_ptitle, poll_ref->Votes().size()); + + if (fQtActive && !poll_ref->Expired(GetAdjustedTime())) { + uiInterface.NewVoteReceived(ctx.m_tx.GetHash()); + } } return;