X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fnet.cpp;h=9f53617a433051211e51c5ab5d3c690ce2f1afcc;hb=5992b46d50261d4848eec11626fbf8f70654d4e7;hp=74edc1dd5ff43f15d6b7c93e99d2983d8e46f436;hpb=c1153fd4f8717ba1ae62ec7f89c5d0d50718b37b;p=novacoin.git diff --git a/src/net.cpp b/src/net.cpp index 74edc1d..9f53617 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -9,6 +9,8 @@ #include "init.h" #include "addrman.h" #include "ui_interface.h" +#include "miner.h" +#include "ntp.h" #ifdef WIN32 #include @@ -478,8 +480,7 @@ void CNode::Cleanup() void CNode::PushVersion() { - /// when NTP implemented, change to just nTime = GetAdjustedTime() - int64_t nTime = (fInbound ? GetAdjustedTime() : GetTime()); + int64_t nTime = GetAdjustedTime(); CAddress addrYou, addrMe; bool fHidden = false; @@ -1214,6 +1215,7 @@ const char* pchTorSeed[] = "seed24u5dwph3qw4.onion", "mj26ulzbs2oskgym.onion", "eqon4usunavt76m7.onion", + "seedd3aldwpslzl3.onion" }; void DumpAddresses() @@ -1296,27 +1298,6 @@ void static ProcessOneShot() } } -// ppcoin: stake minter thread -void static ThreadStakeMinter(void* parg) -{ - printf("ThreadStakeMinter started\n"); - CWallet* pwallet = (CWallet*)parg; - try - { - vnThreadsRunning[THREAD_MINTER]++; - StakeMiner(pwallet); - vnThreadsRunning[THREAD_MINTER]--; - } - catch (std::exception& e) { - vnThreadsRunning[THREAD_MINTER]--; - PrintException(&e, "ThreadStakeMinter()"); - } catch (...) { - vnThreadsRunning[THREAD_MINTER]--; - PrintException(NULL, "ThreadStakeMinter()"); - } - printf("ThreadStakeMinter exiting, %d threads remaining\n", vnThreadsRunning[THREAD_MINTER]); -} - void ThreadOpenConnections2(void* parg) { printf("ThreadOpenConnections started\n"); @@ -1945,9 +1926,16 @@ void StartNode(void* parg) if (!NewThread(ThreadDumpAddress, NULL)) printf("Error; NewThread(ThreadDumpAddress) failed\n"); - // ppcoin: mint proof-of-stake blocks in the background - if (!NewThread(ThreadStakeMinter, pwalletMain)) - printf("Error: NewThread(ThreadStakeMinter) failed\n"); + // Mine proof-of-stake blocks in the background + if (!NewThread(ThreadStakeMiner, pwalletMain)) + printf("Error: NewThread(ThreadStakeMiner) failed\n"); + + // Trusted NTP server, it's localhost by default. + strTrustedUpstream = GetArg("-ntp", "localhost"); + + // Start periodical NTP sampling thread + NewThread(ThreadNtpSamples, NULL); + } bool StopNode()