@@ -2963,6 +2963,10 @@ MinedType GetGeneratedType(const CWallet *wallet, const uint256& tx, unsigned in
2963
2963
bool fIsCoinStakeMine = (wallet->IsMine (wallettx.vout [1 ]) != ISMINE_NO) ? true : false ;
2964
2964
bool fIsOutputMine = (wallet->IsMine (wallettx.vout [vout]) != ISMINE_NO) ? true : false ;
2965
2965
2966
+ // This will be at an index value one unit beyond the end of the vector is m_mrc_researchers.size()
2967
+ // in the claim is zero.
2968
+ unsigned int mrc_index_start = wallettx.vout .size () - blkindex->m_mrc_researchers .size ();
2969
+
2966
2970
// If output 1 is mine and the pubkey (address) for the output is the same as
2967
2971
// output 1, it is a split stake return from my stake.
2968
2972
if (fIsCoinStakeMine && wallettx.vout [vout].scriptPubKey == wallettx.vout [1 ].scriptPubKey )
@@ -2987,27 +2991,32 @@ MinedType GetGeneratedType(const CWallet *wallet, const uint256& tx, unsigned in
2987
2991
return MinedType::POR_SIDE_STAKE_RCV;
2988
2992
}
2989
2993
// ... or the output is not mine, then this must be a
2990
- // sidestake sent to someone else.
2994
+ // sidestake sent to someone else or an MRC payment .
2991
2995
else
2992
2996
{
2993
- if (blkindex->ResearchSubsidy () == 0 )
2997
+ if (blkindex->ResearchSubsidy () == 0 && vout < mrc_index_start) {
2994
2998
return MinedType::POS_SIDE_STAKE_SEND;
2995
- else
2999
+ } else if (vout >= mrc_index_start) {
3000
+ return MinedType::MRC_SEND;
3001
+ } else {
2996
3002
return MinedType::POR_SIDE_STAKE_SEND;
3003
+ }
2997
3004
}
2998
3005
}
2999
3006
// otherwise, the coinstake return is not mine... (i.e. someone else...)
3000
3007
else
3001
3008
{
3002
3009
// ... but the output is mine, then this must be a
3003
- // received sidestake from the staker.
3010
+ // received sidestake or mrc payment from the staker.
3004
3011
if (fIsOutputMine )
3005
3012
{
3006
- if (blkindex->ResearchSubsidy () == 0 )
3013
+ if (blkindex->ResearchSubsidy () == 0 && vout < mrc_index_start) {
3007
3014
return MinedType::POS_SIDE_STAKE_RCV;
3008
-
3009
- else
3015
+ } else if (vout >= mrc_index_start) {
3016
+ return MinedType::MRC_RCV;
3017
+ } else {
3010
3018
return MinedType::POR_SIDE_STAKE_RCV;
3019
+ }
3011
3020
}
3012
3021
3013
3022
// the asymmetry is that the case when neither the first coinstake output
0 commit comments