Browse Source

Merge pull request #2187 from CodeShark/SyncWithWalletsFix

Bugfix - Moved SyncWithWallets out of ProcessMessage and into CTxMemPool::accept()
miguelfreitas
Gavin Andresen 12 years ago
parent
commit
09c69c03f7
  1. 3
      src/main.cpp

3
src/main.cpp

@ -787,6 +787,7 @@ bool CTxMemPool::accept(CTransaction &tx, bool fCheckInputs,
// If updated, erase old tx from wallet // If updated, erase old tx from wallet
if (ptxOld) if (ptxOld)
EraseFromWallets(ptxOld->GetHash()); EraseFromWallets(ptxOld->GetHash());
SyncWithWallets(hash, tx, NULL, true);
printf("CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n", printf("CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n",
hash.ToString().substr(0,10).c_str(), hash.ToString().substr(0,10).c_str(),
@ -3420,7 +3421,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
bool fMissingInputs = false; bool fMissingInputs = false;
if (tx.AcceptToMemoryPool(true, &fMissingInputs)) if (tx.AcceptToMemoryPool(true, &fMissingInputs))
{ {
SyncWithWallets(inv.hash, tx, NULL, true);
RelayTransaction(tx, inv.hash, vMsg); RelayTransaction(tx, inv.hash, vMsg);
mapAlreadyAskedFor.erase(inv); mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash); vWorkQueue.push_back(inv.hash);
@ -3443,7 +3443,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (tx.AcceptToMemoryPool(true, &fMissingInputs2)) if (tx.AcceptToMemoryPool(true, &fMissingInputs2))
{ {
printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str()); printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
SyncWithWallets(inv.hash, tx, NULL, true);
RelayTransaction(tx, inv.hash, vMsg); RelayTransaction(tx, inv.hash, vMsg);
mapAlreadyAskedFor.erase(inv); mapAlreadyAskedFor.erase(inv);
vWorkQueue.push_back(inv.hash); vWorkQueue.push_back(inv.hash);

Loading…
Cancel
Save