mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +00:00
Move lock from RPCHandler to InfoSub.
This commit is contained in:
@@ -33,11 +33,14 @@ protected:
|
||||
boost::unordered_set<RippleAddress> mSubAccountInfo;
|
||||
boost::unordered_set<RippleAddress> mSubAccountTransaction;
|
||||
|
||||
boost::mutex mLock;
|
||||
|
||||
public:
|
||||
void insertSubAccountInfo(RippleAddress addr)
|
||||
{
|
||||
mSubAccountInfo.insert(addr);
|
||||
}
|
||||
void insertSubAccountInfo(RippleAddress addr)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
mSubAccountInfo.insert(addr);
|
||||
}
|
||||
};
|
||||
|
||||
class NetworkOPs
|
||||
|
||||
@@ -2023,8 +2023,6 @@ Json::Value RPCHandler::doSubscribe(const Json::Value& jvRequest)
|
||||
jvResult["error"] = "malformedAccount";
|
||||
}else
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
|
||||
BOOST_FOREACH(const RippleAddress& naAccountID, usnaAccoundIds)
|
||||
{
|
||||
isCurrent->insertSubAccountInfo(naAccountID);
|
||||
@@ -2043,8 +2041,6 @@ Json::Value RPCHandler::doSubscribe(const Json::Value& jvRequest)
|
||||
jvResult["error"] = "malformedAccount";
|
||||
}else
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
|
||||
BOOST_FOREACH(const RippleAddress& naAccountID, usnaAccoundIds)
|
||||
{
|
||||
isCurrent->insertSubAccountInfo(naAccountID);
|
||||
@@ -2101,8 +2097,6 @@ Json::Value RPCHandler::doUnsubscribe(const Json::Value& jvRequest)
|
||||
jvResult["error"] = "malformedAccount";
|
||||
}else
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
|
||||
BOOST_FOREACH(const RippleAddress& naAccountID, usnaAccoundIds)
|
||||
{
|
||||
isCurrent->insertSubAccountInfo(naAccountID);
|
||||
@@ -2121,8 +2115,6 @@ Json::Value RPCHandler::doUnsubscribe(const Json::Value& jvRequest)
|
||||
jvResult["error"] = "malformedAccount";
|
||||
}else
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
|
||||
BOOST_FOREACH(const RippleAddress& naAccountID, usnaAccoundIds)
|
||||
{
|
||||
isCurrent->insertSubAccountInfo(naAccountID);
|
||||
|
||||
@@ -8,7 +8,6 @@ class RPCHandler
|
||||
{
|
||||
NetworkOPs* mNetOps;
|
||||
InfoSub* isCurrent;
|
||||
boost::mutex mLock;
|
||||
|
||||
typedef Json::Value (RPCHandler::*doFuncPtr)(const Json::Value ¶ms);
|
||||
enum {
|
||||
|
||||
Reference in New Issue
Block a user