From 336fe971e68f0336d42e1fa930b6a9c717f612e0 Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Sun, 6 Jan 2013 04:30:00 -0800 Subject: Get rid of db dependencies on main --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index dcc43d836..e4cb2f1d0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -928,6 +928,7 @@ bool AppInit2(boost::thread_group& threadGroup) nStart = GetTimeMillis(); { + CAddrDB::SetMessageStart(pchMessageStart); CAddrDB adb; if (!adb.Read(addrman)) printf("Invalid or missing peers.dat; recreating\n"); -- cgit v1.2.3 From 4751d07efdc3924a005bbe61b358d320f0c710af Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Mon, 7 Jan 2013 07:35:31 -0800 Subject: Moved unrelated-to-network calls in StartNode and StopNode into init.cpp --- src/init.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index e4cb2f1d0..48fd5ae97 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -45,6 +45,7 @@ enum BindFlags { BF_REPORT_ERROR = (1U << 1) }; + ////////////////////////////////////////////////////////////////////////////// // // Shutdown @@ -99,6 +100,7 @@ void Shutdown() StopRPCThreads(); ShutdownRPCMining(); bitdb.Flush(false); + GenerateBitcoins(false, NULL); StopNode(); { LOCK(cs_main); -- cgit v1.2.3 From 663224c2324d64134f8587fe77d1d787c0353b20 Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Mon, 7 Jan 2013 08:07:51 -0800 Subject: Removed net.cpp's dependency on init.h. Added explicit include of main.h in init.cpp, changed include of init.h to include of main.h in net.cpp. Added function registration for net.cpp in init.cpp's network initialization. Removed protocol.cpp's dependency on main.h. TODO: Remove main.h include in net.cpp. --- src/init.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 48fd5ae97..1eee4d247 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -3,11 +3,12 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "init.h" +#include "main.h" #include "txdb.h" #include "walletdb.h" #include "bitcoinrpc.h" #include "net.h" -#include "init.h" #include "util.h" #include "ui_interface.h" #include "checkpoints.h" @@ -569,6 +570,10 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 6: network initialization + SetProcessMessagesHandler(ProcessMessages); + SetSendMessagesHandler(SendMessages); + SetStartShutdownHandler(StartShutdown); + int nSocksVersion = GetArg("-socks", 5); if (nSocksVersion != 4 && nSocksVersion != 5) return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); -- cgit v1.2.3 From 05df3fc68d68e87415ed9e534db3ea3160dc3092 Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Tue, 8 Jan 2013 04:17:15 -0800 Subject: Removed AcceptToMemoryPool method from CTransaction. This method belongs to the mempool instance. Removed AreInputsStandard from CTransaction, made it a regular function in main. Moved CTransaction::GetOutputFor to CCoinsViewCache. Moved GetLegacySigOpCount and GetP2SHSigOpCount out of CTransaction into regular functions in main. Moved GetValueIn and HaveInputs from CTransaction into CCoinsViewCache. Moved AllowFree, ClientCheckInputs, CheckInputs, UpdateCoins, and CheckTransaction out of CTransaction and into main. Moved IsStandard and IsFinal out of CTransaction and put them in main as IsStandardTx and IsFinalTx. Moved GetValueOut out of CTransaction into main. Moved CTxIn, CTxOut, and CTransaction into core. Added minimum fee parameter to CTxOut::IsDust() temporarily until CTransaction is moved to core.h so that CTxOut needn't know about CTransaction. --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 1eee4d247..a1dbfd2a5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -5,6 +5,7 @@ #include "init.h" #include "main.h" +#include "core.h" #include "txdb.h" #include "walletdb.h" #include "bitcoinrpc.h" -- cgit v1.2.3 From 501da2503a39dd88470df89ccc923c696fe6b111 Mon Sep 17 00:00:00 2001 From: Eric Lombrozo Date: Wed, 5 Jun 2013 20:21:41 -0700 Subject: Using boost::signals2 to message main from net.cpp. --- src/init.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index a1dbfd2a5..f8b2b23fd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -571,10 +571,8 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 6: network initialization - SetProcessMessagesHandler(ProcessMessages); - SetSendMessagesHandler(SendMessages); - SetStartShutdownHandler(StartShutdown); - + RegisterNodeSignals(GetNodeSignals()); + int nSocksVersion = GetArg("-socks", 5); if (nSocksVersion != 4 && nSocksVersion != 5) return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); -- cgit v1.2.3