mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Initial support for fetch newcoin.txt via https.
This commit is contained in:
@@ -3,22 +3,48 @@
|
||||
|
||||
#include "../json/value.h"
|
||||
|
||||
#include "uint256.h"
|
||||
#include "NewcoinAddress.h"
|
||||
|
||||
#include "HttpsClient.h"
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/container/deque.hpp>
|
||||
|
||||
// Guarantees minimum thoughput of 1 node per second.
|
||||
#define NODE_FETCH_JOBS 10
|
||||
#define NODE_FETCH_SECONDS 10
|
||||
#define NODE_FILE_BYTES_MAX (50<<10) // 50k
|
||||
#define NODE_FILE_NAME "newcoin.txt"
|
||||
#define NODE_FILE_PATH "/" NODE_FILE_NAME
|
||||
|
||||
class UniqueNodeList
|
||||
{
|
||||
private:
|
||||
void fetchResponse(const boost::system::error_code& err, std::string strResponse);
|
||||
|
||||
// hanko to public key
|
||||
//std::map<uint160, uint256> mUNL;
|
||||
|
||||
boost::mutex mFetchLock;
|
||||
int mFetchActive; // count of active fetches
|
||||
boost::container::deque<std::string> mFetchPending;
|
||||
|
||||
void fetchNext();
|
||||
void fetchProcess(std::string strDomain);
|
||||
|
||||
public:
|
||||
void addNode(NewcoinAddress nodePublic, std::string strComment);
|
||||
void removeNode(NewcoinAddress hanko);
|
||||
UniqueNodeList();
|
||||
|
||||
void addNode(NewcoinAddress naNodePublic, std::string strComment);
|
||||
void fetchNode(std::string strDomain);
|
||||
void removeNode(NewcoinAddress naHanko);
|
||||
void reset();
|
||||
|
||||
// 0- we don't care, 1- we care and is valid, 2-invalid signature
|
||||
// 2- we don't care, 1- we care and is valid, 2-invalid signature
|
||||
// int checkValid(newcoin::Validation& valid);
|
||||
|
||||
Json::Value getUnlJson();
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user