Must be the same bug. It's one day left until the hard fork, not good to rush with additional changes. Even if it doesn't, we can fix it later without a hard fork.
If it can be fixed without hard fork then no need to rush of course.
I will check after 1.4.2 hard fork if it change anything but right now i am start thinking what coins additions for inputs <20 ORBs not working properly at all (even if PoS kernel and additional inputs both > 9 days old).
I monitor my primary large PoS mining wallet (~ 300 inputs now, ~ 5000 ORBs).
Last 3 days it produce PoS blocks fine and non stop. About 80 PoS blocks already mined, and generations now slowing down because wallet running out of inputs > 9 days old. (i expect new wave of PoS after hard fork when inputs 5-9 days old will start work too)
But ALL of my ~80 PoS blocks was generated by inputs >= 20 ORBs only.
And no single PoS block for inputs < 20 ORBs.
My wallet contains 35 inputs < 20 ORBs which is 3 - 18 ORBs in size each and 11 - 14 days old. Still not get a single PoS for them but logs shows lot of ERROR: CreateCoinStake() : stake amount below the minimum
This indicate what wallet keep finding PoS kernels but can not produce full PoS blocks based on inputs <20 ORBs.
Same situation with my other wallet running 24/7 on another machine where a LOT (~150 now) of 2 ORBs inputs (coins from PoW solo mined blocks) with age > 9 days at same address can not produce single PoS bock (and ERROR: CreateCoinStake() : stake amount below the minimum in logs too).
I check this part of source code myself but not found any errors:
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
// Attempt to add more inputs
// Only add coins of the same key/address as kernel
if (txNew.vout.size() == 2 && ((pcoin.first->vout[pcoin.second].scriptPubKey == scriptPubKeyKernel || pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey))
&& pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
{
int64 nTimeWeight = GetWeight((int64)pcoin.first->nTime, (int64)txNew.nTime);
/* Do not add too many inputs */
if(txNew.vin.size() >= 10)
break;
/* Do not add any inputs if above the threshold already */
if(nCredit > nCombineThreshold)
break;
/* Do not add a new input exceeding the stake limit if defined */
if(nCredit + pcoin.first->vout[pcoin.second].nValue > nBalance - nReserveBalance)
break;
/* Do not add any large inputs capable of stake generation on their own */
if(pcoin.first->vout[pcoin.second].nValue > nCombineThreshold)
continue;
/* Do not add any inputs under the min. age */
if(nTimeWeight < nStakeMinAge)
continue;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
vwtxPrev.push_back(pcoin.first);
}
}
/* Fail if the minimal stake amount not reached */
if(nCredit < MIN_STAKE_AMOUNT)
return error("CreateCoinStake() : stake amount below the minimum");
All seems simple and correct for me except first check which i not fully understand (and if input not pass it it rejected)
if (txNew.vout.size() == 2 && ((pcoin.first->vout[pcoin.second].scriptPubKey == scriptPubKeyKernel || pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey)) && pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
txNew.vout.size() == 2 means what coins additions will work only for PoS blocks with 2 outputs? And why this restriction needed? 2 outputs in PoS block produced if block is splited (and blocks splits if input generates PoS blocks before reaching max stake age) so it will never work for old inputs?
Or if coins base also counted in txNew.vout.size() then it will work only for old (> max stake ages) inputs and NOT work for inputs < max stake age?
So i not understand why we need this check about 2 outputs?
P.S.
2 ALL
Although this problem looks insignificant at first sight, it actually important. Because now wallet while PoS mining splits PoS blocks into 2 parts (if block was found before input reach the maximum stake age = 20 days at the moment), over time in an actively used wallet this result ALL inputs will be sliced to pieces less than 20 ORBs (not matter how large it was at beginning - e.g. 150/2=75/2=37.5/2=18.75<20 after 3 rounds) and PoS mining will stop until the user manually glue/melt them back into larger pieces via coin control. That aside much time on boring and monotonous work also destroy all accumulated coin-days.
So an automated process that would gather them back into large pieces are very important for successful PoS realization