Skip to content

Commit

Permalink
Added ReacceptWalletTransactions() registered wallet function in main…
Browse files Browse the repository at this point in the history
… rather than iterating through the wallet map in init.
  • Loading branch information
CodeShark committed Jan 10, 2013
1 parent d8b0cf1 commit 3d15116
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,7 @@ bool AppInit2()
return InitError(strErrors.str());

// Add wallet transactions that aren't already in a block to mapTransactions
BOOST_FOREACH(const wallet_map::value_type& item, pWalletMap->GetWalletMap())
item.second->ReacceptWalletTransactions();
ReacceptWalletTransactions();

#if !defined(QT_GUI)
// Loop until process is exit()ed from shutdown() function,
Expand Down
12 changes: 10 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock*
}
}

// Add wallet transactions that aren't already in a block to mapTransactions
void ReacceptWalletTransactions()
{
{
LOCK(cs_setpwalletRegistered);
BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
pwallet->ReacceptWalletTransactions();
}
}

// notify wallets about a new best chain
void static SetBestChain(const CBlockLocator& loc)
{
Expand Down Expand Up @@ -196,8 +206,6 @@ void static ResendWalletTransactions()





//////////////////////////////////////////////////////////////////////////////
//
// CCoinsView implementations
Expand Down
2 changes: 2 additions & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ void UnregisterWallet(CWallet* pwalletIn);
void UnregisterAllWallets();
/** Push an updated transaction to all registered wallets */
void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false);
/** Add wallet transactions that aren't already in a block to mapTransactions */
void ReacceptWalletTransactions();
/** Process an incoming block */
bool ProcessBlock(CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL);
/** Check whether enough disk space is available for an incoming block */
Expand Down

0 comments on commit 3d15116

Please sign in to comment.