mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Cleanly destroy Application on exit
This commit is contained in:
@@ -52,10 +52,10 @@ private:
|
||||
RippleAddress signer = val->getSignerPublic ();
|
||||
bool isCurrent = false;
|
||||
|
||||
if (theApp->getUNL ().nodeInUNL (signer) || val->isTrusted ())
|
||||
if (getApp().getUNL ().nodeInUNL (signer) || val->isTrusted ())
|
||||
{
|
||||
val->setTrusted ();
|
||||
uint32 now = theApp->getOPs ().getCloseTimeNC ();
|
||||
uint32 now = getApp().getOPs ().getCloseTimeNC ();
|
||||
uint32 valClose = val->getSignTime ();
|
||||
|
||||
if ((now > (valClose - LEDGER_EARLY_INTERVAL)) && (now < (valClose + LEDGER_VAL_INTERVAL)))
|
||||
@@ -104,7 +104,7 @@ private:
|
||||
<< " added " << (val->isTrusted () ? "trusted/" : "UNtrusted/") << (isCurrent ? "current" : "stale");
|
||||
|
||||
if (val->isTrusted ())
|
||||
theApp->getLedgerMaster ().checkAccept (hash);
|
||||
getApp().getLedgerMaster ().checkAccept (hash);
|
||||
|
||||
// FIXME: This never forwards untrusted validations
|
||||
return isCurrent;
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
|
||||
if (set)
|
||||
{
|
||||
uint32 now = theApp->getOPs ().getNetworkTimeNC ();
|
||||
uint32 now = getApp().getOPs ().getNetworkTimeNC ();
|
||||
BOOST_FOREACH (u160_val_pair & it, *set)
|
||||
{
|
||||
bool isTrusted = it.second->isTrusted ();
|
||||
@@ -241,7 +241,7 @@ private:
|
||||
|
||||
std::list<SerializedValidation::pointer> getCurrentTrustedValidations ()
|
||||
{
|
||||
uint32 cutoff = theApp->getOPs ().getNetworkTimeNC () - LEDGER_VAL_INTERVAL;
|
||||
uint32 cutoff = getApp().getOPs ().getNetworkTimeNC () - LEDGER_VAL_INTERVAL;
|
||||
|
||||
std::list<SerializedValidation::pointer> ret;
|
||||
|
||||
@@ -276,7 +276,7 @@ private:
|
||||
boost::unordered_map<uint256, currentValidationCount>
|
||||
getCurrentValidations (uint256 currentLedger, uint256 priorLedger)
|
||||
{
|
||||
uint32 cutoff = theApp->getOPs ().getNetworkTimeNC () - LEDGER_VAL_INTERVAL;
|
||||
uint32 cutoff = getApp().getOPs ().getNetworkTimeNC () - LEDGER_VAL_INTERVAL;
|
||||
bool valCurrentLedger = currentLedger.isNonZero ();
|
||||
bool valPriorLedger = priorLedger.isNonZero ();
|
||||
|
||||
@@ -358,13 +358,13 @@ private:
|
||||
return;
|
||||
|
||||
mWriting = true;
|
||||
theApp->getJobQueue ().addJob (jtWRITE, "Validations::doWrite",
|
||||
getApp().getJobQueue ().addJob (jtWRITE, "Validations::doWrite",
|
||||
BIND_TYPE (&Validations::doWrite, this, P_1));
|
||||
}
|
||||
|
||||
void doWrite (Job&)
|
||||
{
|
||||
LoadEvent::autoptr event (theApp->getJobQueue ().getLoadEventAP (jtDISK, "ValidationWrite"));
|
||||
LoadEvent::autoptr event (getApp().getJobQueue ().getLoadEventAP (jtDISK, "ValidationWrite"));
|
||||
boost::format insVal ("INSERT INTO Validations "
|
||||
"(LedgerHash,NodePubKey,SignTime,RawData) VALUES ('%s','%s','%u',%s);");
|
||||
|
||||
@@ -378,8 +378,8 @@ private:
|
||||
mStaleValidations.swap (vector);
|
||||
sl.unlock ();
|
||||
{
|
||||
Database* db = theApp->getLedgerDB ()->getDB ();
|
||||
ScopedLock dbl (theApp->getLedgerDB ()->getDBLock ());
|
||||
Database* db = getApp().getLedgerDB ()->getDB ();
|
||||
ScopedLock dbl (getApp().getLedgerDB ()->getDBLock ());
|
||||
|
||||
Serializer s (1024);
|
||||
db->executeSQL ("BEGIN TRANSACTION;");
|
||||
|
||||
Reference in New Issue
Block a user