@@ -1182,25 +1182,47 @@ AccrualComputer Tally::GetLegacyComputer(
1182
1182
last_block_ptr->nHeight );
1183
1183
}
1184
1184
1185
+ // TODO: Verify RecordRewardBlock works correctly with MRC's
1185
1186
void Tally::RecordRewardBlock (const CBlockIndex* const pindex)
1186
1187
{
1187
- if (!pindex || pindex->ResearchSubsidy () <= 0 ) {
1188
- return ;
1188
+ if (!pindex) return ;
1189
+
1190
+ // Record tally for staker's research
1191
+ if (pindex->ResearchSubsidy () > 0 ) {
1192
+ if (const CpidOption cpid = pindex->GetMiningId ().TryCpid ()) {
1193
+ g_researcher_tally.RecordRewardBlock (*cpid, pindex);
1194
+ }
1189
1195
}
1190
1196
1191
- if (const CpidOption cpid = pindex->GetMiningId ().TryCpid ()) {
1192
- g_researcher_tally.RecordRewardBlock (*cpid, pindex);
1197
+ // Record tally for manual reward claims
1198
+ if (pindex->ResearchMRCSubsidy () > 0 ) {
1199
+ for (const auto & mrc_researcher : pindex->m_mrc_researchers ) {
1200
+ Cpid cpid = mrc_researcher->m_cpid ;
1201
+
1202
+ g_researcher_tally.RecordRewardBlock (cpid, pindex);
1203
+ }
1193
1204
}
1194
1205
}
1195
1206
1207
+ // TODO: Verify ForgetRewardBlock works correctly with MRC's
1196
1208
void Tally::ForgetRewardBlock (const CBlockIndex* const pindex)
1197
1209
{
1198
- if (!pindex || pindex->ResearchSubsidy () <= 0 ) {
1199
- return ;
1210
+ if (!pindex) return ;
1211
+
1212
+ // Un-record tally for staker's research
1213
+ if (pindex->ResearchSubsidy () > 0 ) {
1214
+ if (const CpidOption cpid = pindex->GetMiningId ().TryCpid ()) {
1215
+ g_researcher_tally.ForgetRewardBlock (*cpid, pindex);
1216
+ }
1200
1217
}
1201
1218
1202
- if (const CpidOption cpid = pindex->GetMiningId ().TryCpid ()) {
1203
- g_researcher_tally.ForgetRewardBlock (*cpid, pindex);
1219
+ // Un-record tally for manual reward claims
1220
+ if (pindex->ResearchMRCSubsidy () > 0 ) {
1221
+ for (const auto & mrc_researcher : pindex->m_mrc_researchers ) {
1222
+ Cpid cpid = mrc_researcher->m_cpid ;
1223
+
1224
+ g_researcher_tally.ForgetRewardBlock (cpid, pindex);
1225
+ }
1204
1226
}
1205
1227
}
1206
1228
0 commit comments