diff options
| author | Pieter Wuille <[email protected]> | 2013-10-19 18:42:14 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2013-10-26 14:51:47 +0200 |
| commit | 722fa283d04dfe9c70418e69535a08eea06b4377 (patch) | |
| tree | c917f101a743cebd52c17ac777d47ed44c35c1fa /src/wallet.cpp | |
| parent | Use boost signals for callbacks from main to wallet (diff) | |
| download | discoin-722fa283d04dfe9c70418e69535a08eea06b4377.tar.xz discoin-722fa283d04dfe9c70418e69535a08eea06b4377.zip | |
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.
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index bd9e2c734..ea1e01e6e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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); |