Break dependency of init on wallet.

This required some code movement (what was CWalletTx::AcceptToMemoryPool
doing in main?), and adding a few explicit includes that used to be
implicit through init.h.
This commit is contained in:
Pieter Wuille
2013-10-19 18:42:14 +02:00
parent 00588c3fac
commit 722fa283d0
7 changed files with 32 additions and 22 deletions

View File

@@ -777,6 +777,25 @@ void CWalletTx::AddSupportingTransactions()
reverse(vtxPrev.begin(), vtxPrev.end());
}
bool CWalletTx::AcceptWalletTransaction()
{
{
LOCK(mempool.cs);
// Add previous supporting transactions first
BOOST_FOREACH(CMerkleTx& tx, vtxPrev)
{
if (!tx.IsCoinBase())
{
uint256 hash = tx.GetHash();
if (!mempool.exists(hash) && pcoinsTip->HaveCoins(hash))
tx.AcceptToMemoryPool(false);
}
}
return AcceptToMemoryPool(false);
}
return false;
}
bool CWalletTx::WriteToDisk()
{
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);