1005 | @@ -997,9 +1006,10 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed) const
1006 | continue;
1007 |
1008 | for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
1009 | - if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) &&
1010 | + isminetype mine = IsMine(pcoin->vout[i]);
1011 | + if (!(pcoin->IsSpent(i)) && mine &&
1012 | !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0)
1013 | - vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain()));
1014 | + vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain(), mine == MINE_SPENDABLE));
Does it really make sense to include a spendability boolean in each COutput? Your code doesn't seem to actually use it anywhere. The last parameter of COutput doesn't seem to be useful in its current form because it is ascertained too late to be useful. What plans did you have for it? Perhaps it would be more useful as the tri-state enum instead of boolean?
https://github.com/litecoin-project/bitcoinomg/commit/8ebd9b64a8974d2fbc47fffdef5dbd72d3860a37
The simplest way I could think of to combine watchonly with coincontrol was to add a fOnlySpendable boolean to AvailableCoins(). This allowed me to filter the watchonly outputs from the coincontrol selection dialog. Can you think of a better way?