}
// clean up wallet after disconnecting coinstake
- SyncWithWallets(vtx[i].GetHash(), vtx[i], this, true, false);
+ SyncWithWallets(vtx[i].GetHash(), vtx[i], this, false, false);
}
// move best block pointer to prevout block
}
else
printf("AddToWallet() : found %s in block %s not in index\n",
- wtxIn.GetHash().ToString().substr(0,10).c_str(),
+ hash.ToString().substr(0,10).c_str(),
wtxIn.hashBlock.ToString().c_str());
}
}
}
//// debug print
- printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
+ printf("AddToWallet %s %s%s\n", hash.ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
// Write to disk
if (fInsertedNew || fUpdated)
if ( !strCmd.empty())
{
- boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
+ boost::replace_all(strCmd, "%s", hash.GetHex());
boost::thread t(runCommand, strCmd); // thread runs free
}
for (unsigned int n=0; n < pcoin->vout.size(); n++)
{
+ bool fUpdated = false;
if (IsMine(pcoin->vout[n]))
{
if (pcoin->IsSpent(n) && coins.IsAvailable(n))
nBalanceInQuestion += pcoin->vout[n].nValue;
if (!fCheckOnly)
{
+ fUpdated = true;
pcoin->MarkUnspent(n);
pcoin->WriteToDisk();
}
nBalanceInQuestion += pcoin->vout[n].nValue;
if (!fCheckOnly)
{
+ fUpdated = true;
pcoin->MarkSpent(n);
pcoin->WriteToDisk();
}
}
- NotifyTransactionChanged(this, hash, CT_UPDATED);
+ if (fUpdated)
+ NotifyTransactionChanged(this, hash, CT_UPDATED);
}
}
if((pcoin->IsCoinBase() || pcoin->IsCoinStake()) && pcoin->GetDepthInMainChain() == 0)
{
- printf("FixSpentCoins %s orphaned generation tx %s\n", fCheckOnly ? "found" : "removed", hash.ToString().c_str());
if (!fCheckOnly)
{
EraseFromWallet(hash);
+ NotifyTransactionChanged(this, hash, CT_DELETED);
}
+
+ printf("FixSpentCoins %s orphaned generation tx %s\n", fCheckOnly ? "found" : "removed", hash.ToString().c_str());
}
}
}