mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Simplify locking and move a typedef.
* Make DatabaseCon's lock private and expose a scoped lock_guard. * Get rid of DeprecatedRecursiveMutex and DeprecatedScopedLock entirely. * Move CancelCallback to Job where it logically belongs.
This commit is contained in:
committed by
Vinnie Falco
parent
02c2029ac1
commit
6335e34395
@@ -48,7 +48,7 @@ void LocalCredentials::start ()
|
||||
bool LocalCredentials::nodeIdentityLoad ()
|
||||
{
|
||||
Database* db = getApp().getWalletDB ()->getDB ();
|
||||
DeprecatedScopedLock sl (getApp().getWalletDB ()->getDBLock ());
|
||||
auto sl (getApp().getWalletDB ()->lock ());
|
||||
bool bSuccess = false;
|
||||
|
||||
if (db->executeSQL ("SELECT * FROM NodeIdentity;") && db->startIterRows ())
|
||||
@@ -106,7 +106,7 @@ bool LocalCredentials::nodeIdentityCreate ()
|
||||
//
|
||||
Database* db = getApp().getWalletDB ()->getDB ();
|
||||
|
||||
DeprecatedScopedLock sl (getApp().getWalletDB ()->getDBLock ());
|
||||
auto sl (getApp().getWalletDB ()->lock ());
|
||||
db->executeSQL (str (boost::format ("INSERT INTO NodeIdentity (PublicKey,PrivateKey,Dh512,Dh1024) VALUES ('%s','%s',%s,%s);")
|
||||
% naNodePublic.humanNodePublic ()
|
||||
% naNodePrivate.humanNodePrivate ()
|
||||
@@ -124,7 +124,7 @@ bool LocalCredentials::dataDelete (const std::string& strKey)
|
||||
{
|
||||
Database* db = getApp().getRpcDB ()->getDB ();
|
||||
|
||||
DeprecatedScopedLock sl (getApp().getRpcDB ()->getDBLock ());
|
||||
auto sl (getApp().getRpcDB ()->lock ());
|
||||
|
||||
return db->executeSQL (str (boost::format ("DELETE FROM RPCData WHERE Key=%s;")
|
||||
% sqlEscape (strKey)));
|
||||
@@ -134,7 +134,7 @@ bool LocalCredentials::dataFetch (const std::string& strKey, std::string& strVal
|
||||
{
|
||||
Database* db = getApp().getRpcDB ()->getDB ();
|
||||
|
||||
DeprecatedScopedLock sl (getApp().getRpcDB ()->getDBLock ());
|
||||
auto sl (getApp().getRpcDB ()->lock ());
|
||||
|
||||
bool bSuccess = false;
|
||||
|
||||
@@ -156,7 +156,7 @@ bool LocalCredentials::dataStore (const std::string& strKey, const std::string&
|
||||
{
|
||||
Database* db = getApp().getRpcDB ()->getDB ();
|
||||
|
||||
DeprecatedScopedLock sl (getApp().getRpcDB ()->getDBLock ());
|
||||
auto sl (getApp().getRpcDB ()->lock ());
|
||||
|
||||
bool bSuccess = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user