mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Stub subscribe for JSON-RPC.
This commit is contained in:
@@ -22,6 +22,8 @@ class LedgerConsensus;
|
||||
|
||||
DEFINE_INSTANCE(InfoSub);
|
||||
|
||||
class RPCSub;
|
||||
|
||||
class InfoSub : public IS_INSTANCE(InfoSub)
|
||||
{
|
||||
public:
|
||||
@@ -34,12 +36,12 @@ protected:
|
||||
boost::unordered_set<RippleAddress> mSubAccountInfo;
|
||||
boost::unordered_set<RippleAddress> mSubAccountTransaction;
|
||||
|
||||
boost::mutex mLock;
|
||||
boost::mutex mLockInfo;
|
||||
|
||||
public:
|
||||
void insertSubAccountInfo(RippleAddress addr)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
boost::mutex::scoped_lock sl(mLockInfo);
|
||||
mSubAccountInfo.insert(addr);
|
||||
}
|
||||
};
|
||||
@@ -68,6 +70,8 @@ protected:
|
||||
|
||||
typedef boost::unordered_map<uint160,std::pair<InfoSub*,uint32> > subSubmitMapType;
|
||||
|
||||
typedef boost::unordered_map<std::string, InfoSub* > subRpcMapType;
|
||||
|
||||
OperatingMode mMode;
|
||||
bool mNeedNetworkLedger;
|
||||
boost::posix_time::ptime mConnectTime;
|
||||
@@ -97,12 +101,13 @@ protected:
|
||||
subInfoMapType mSubRTAccount;
|
||||
subSubmitMapType mSubmitMap; // TODO: probably dump this
|
||||
|
||||
subRpcMapType mRpcSubMap;
|
||||
|
||||
boost::unordered_set<InfoSub*> mSubLedger; // accepted ledgers
|
||||
boost::unordered_set<InfoSub*> mSubServer; // when server changes connectivity state
|
||||
boost::unordered_set<InfoSub*> mSubTransactions; // all accepted transactions
|
||||
boost::unordered_set<InfoSub*> mSubRTTransactions; // all proposed and accepted transactions
|
||||
|
||||
|
||||
void setMode(OperatingMode);
|
||||
|
||||
Json::Value transJson(const SerializedTransaction& stTxn, TER terResult, bool bAccepted, Ledger::ref lpCurrent, const std::string& strType);
|
||||
@@ -270,6 +275,9 @@ public:
|
||||
|
||||
bool subRTTransactions(InfoSub* ispListener);
|
||||
bool unsubRTTransactions(InfoSub* ispListener);
|
||||
|
||||
RPCSub* findRpcSub(const std::string& strRpc);
|
||||
RPCSub* addRpcSub(const std::string& strRpc, RPCSub* rspEntry);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user