mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Remove dead code TimingService.
This commit is contained in:
@@ -106,8 +106,6 @@ void Application::run()
|
|||||||
//
|
//
|
||||||
mConnectionPool.start();
|
mConnectionPool.start();
|
||||||
|
|
||||||
mTimingService.start(mIOService);
|
|
||||||
|
|
||||||
// Temporary root account will be ["This is my payphrase."]:0
|
// Temporary root account will be ["This is my payphrase."]:0
|
||||||
NewcoinAddress rootFamilySeed; // Hold the 128 password.
|
NewcoinAddress rootFamilySeed; // Hold the 128 password.
|
||||||
NewcoinAddress rootFamilyGenerator; // Hold the generator.
|
NewcoinAddress rootFamilyGenerator; // Hold the generator.
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "UniqueNodeList.h"
|
#include "UniqueNodeList.h"
|
||||||
#include "ConnectionPool.h"
|
#include "ConnectionPool.h"
|
||||||
#include "TimingService.h"
|
|
||||||
#include "PubKeyCache.h"
|
#include "PubKeyCache.h"
|
||||||
#include "ScopedLock.h"
|
#include "ScopedLock.h"
|
||||||
#include "LedgerMaster.h"
|
#include "LedgerMaster.h"
|
||||||
@@ -38,7 +37,6 @@ class Application
|
|||||||
|
|
||||||
NetworkOPs mNetOps;
|
NetworkOPs mNetOps;
|
||||||
Wallet mWallet;
|
Wallet mWallet;
|
||||||
TimingService mTimingService;
|
|
||||||
UniqueNodeList mUNL;
|
UniqueNodeList mUNL;
|
||||||
PubKeyCache mPKCache;
|
PubKeyCache mPKCache;
|
||||||
LedgerMaster mMasterLedger;
|
LedgerMaster mMasterLedger;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "LedgerMaster.h"
|
#include "LedgerMaster.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "NewcoinAddress.h"
|
#include "NewcoinAddress.h"
|
||||||
#include "TimingService.h"
|
|
||||||
#include "Conversion.h"
|
#include "Conversion.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -24,14 +24,9 @@ NetworkOPs::NetworkOPs(boost::asio::io_service& io_service) : mMode(omDISCONNECT
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t NetworkOPs::getNetworkTimeTT()
|
|
||||||
{
|
|
||||||
return time(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
boost::posix_time::ptime NetworkOPs::getNetworkTimePT()
|
boost::posix_time::ptime NetworkOPs::getNetworkTimePT()
|
||||||
{
|
{
|
||||||
return boost::posix_time::from_time_t(getNetworkTimeTT());
|
return boost::posix_time::second_clock::universal_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 NetworkOPs::getNetworkTimeNC()
|
uint64 NetworkOPs::getNetworkTimeNC()
|
||||||
@@ -356,4 +351,4 @@ void NetworkOPs::switchLastClosedLedger(Ledger::pointer newLedger, bool normal)
|
|||||||
boost::make_shared<PackedMessage>(PackedMessage::MessagePointer(s), newcoin::mtSTATUS_CHANGE);
|
boost::make_shared<PackedMessage>(PackedMessage::MessagePointer(s), newcoin::mtSTATUS_CHANGE);
|
||||||
theApp->getConnectionPool().relayMessage(NULL, packet);
|
theApp->getConnectionPool().relayMessage(NULL, packet);
|
||||||
}
|
}
|
||||||
|
// vim:ts=4
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ public:
|
|||||||
|
|
||||||
// network information
|
// network information
|
||||||
uint64 getNetworkTimeNC();
|
uint64 getNetworkTimeNC();
|
||||||
time_t getNetworkTimeTT();
|
|
||||||
boost::posix_time::ptime getNetworkTimePT();
|
boost::posix_time::ptime getNetworkTimePT();
|
||||||
uint32 getCurrentLedgerID();
|
uint32 getCurrentLedgerID();
|
||||||
OperatingMode getOperatingMode() { return mMode; }
|
OperatingMode getOperatingMode() { return mMode; }
|
||||||
@@ -74,3 +73,4 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
// vim:ts=4
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
#include "TimingService.h"
|
|
||||||
#include "Config.h"
|
|
||||||
#include "Application.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <ctime>
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Only needs to start once we determine the network time
|
|
||||||
*/
|
|
||||||
|
|
||||||
TimingService::TimingService() : mLedgerTimer(NULL), mPropTimer(NULL), mValidTimer(NULL)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimingService::start(boost::asio::io_service& ioService)
|
|
||||||
{
|
|
||||||
// TODO: calculate the amount of seconds left in the current ledger
|
|
||||||
mLedgerTimer=new asio::deadline_timer(ioService, posix_time::seconds(theConfig.LEDGER_SECONDS)),
|
|
||||||
mLedgerTimer->async_wait(boost::bind(&TimingService::handleLedger, this));
|
|
||||||
|
|
||||||
mPropTimer=new asio::deadline_timer(ioService, posix_time::seconds(theConfig.LEDGER_PROPOSAL_DELAY_SECONDS));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimingService::handleLedger()
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
theApp->getLedgerMaster().startFinalization();
|
|
||||||
mLedgerTimer->expires_at(mLedgerTimer->expires_at() + boost::posix_time::seconds(theConfig.LEDGER_SECONDS));
|
|
||||||
mLedgerTimer->async_wait(boost::bind(&TimingService::handleLedger, this));
|
|
||||||
|
|
||||||
mPropTimer->expires_at(mLedgerTimer->expires_at() + boost::posix_time::seconds(theConfig.LEDGER_PROPOSAL_DELAY_SECONDS));
|
|
||||||
mPropTimer->async_wait(boost::bind(&TimingService::handleProp, this));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimingService::handleProp()
|
|
||||||
{
|
|
||||||
// theApp->getLedgerMaster().sendProposal();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TimingService::handleValid()
|
|
||||||
{
|
|
||||||
// theApp->getLedgerMaster().endFinalization();
|
|
||||||
}
|
|
||||||
|
|
||||||
int TimingService::getCurrentLedgerIndex()
|
|
||||||
{
|
|
||||||
return( (time(NULL)-theConfig.NETWORK_START_TIME)/theConfig.LEDGER_SECONDS );
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifndef __TIMINGSERVICE__
|
|
||||||
#define __TIMINGSERVICE__
|
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
|
||||||
|
|
||||||
/* responsible for keeping track of network time
|
|
||||||
and kicking off the publishing process
|
|
||||||
*/
|
|
||||||
|
|
||||||
class TimingService
|
|
||||||
{
|
|
||||||
boost::asio::deadline_timer* mLedgerTimer;
|
|
||||||
boost::asio::deadline_timer* mPropTimer;
|
|
||||||
boost::asio::deadline_timer* mValidTimer;
|
|
||||||
|
|
||||||
void handleLedger();
|
|
||||||
void handleProp();
|
|
||||||
void handleValid();
|
|
||||||
public:
|
|
||||||
TimingService();
|
|
||||||
void start(boost::asio::io_service& ioService);
|
|
||||||
|
|
||||||
static int getCurrentLedgerIndex();
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user