More background work/status
This commit is contained in:
@@ -125,6 +125,32 @@ public:
|
||||
_SiaApiError GetFileTree(std::shared_ptr<_CSiaFileTree>& siaFileTree) const;
|
||||
};
|
||||
|
||||
class AFX_EXT_CLASS _CSiaConsensus
|
||||
{
|
||||
friend CSiaApi;
|
||||
private:
|
||||
_CSiaConsensus(CSiaCurl& siaCurl);
|
||||
|
||||
public:
|
||||
~_CSiaConsensus();
|
||||
|
||||
private:
|
||||
CSiaCurl _siaCurl;
|
||||
|
||||
private:
|
||||
HANDLE _stopEvent;
|
||||
std::unique_ptr<std::thread> _refreshThread;
|
||||
|
||||
// Properties
|
||||
Property(std::uint64_t, Height, public, private)
|
||||
Property(bool, Synced, public, private)
|
||||
Property(String, CurrentBlock, public, private)
|
||||
|
||||
private:
|
||||
void StartRefreshThread();
|
||||
void StopRefreshThread();
|
||||
};
|
||||
|
||||
public:
|
||||
CSiaApi(const SiaHostConfig& hostConfig);
|
||||
|
||||
@@ -135,6 +161,7 @@ private:
|
||||
CSiaCurl _siaCurl;
|
||||
std::shared_ptr<_CSiaWallet> _wallet;
|
||||
std::shared_ptr<_CSiaRenter> _renter;
|
||||
std::shared_ptr<_CSiaConsensus> _consensus;
|
||||
|
||||
public:
|
||||
static String FormatToSiaPath(String path);
|
||||
@@ -142,6 +169,7 @@ public:
|
||||
public:
|
||||
std::shared_ptr<_CSiaWallet> GetWallet() const;
|
||||
std::shared_ptr<_CSiaRenter> GetRenter() const;
|
||||
std::shared_ptr<_CSiaConsensus> GetConsensus() const;
|
||||
String GetServerVersion() const;
|
||||
};
|
||||
|
||||
@@ -149,8 +177,10 @@ typedef CSiaApi::_SiaApiError SiaApiError;
|
||||
typedef CSiaApi::_SiaSeedLanguage SiaSeedLanguage;
|
||||
typedef CSiaApi::_CSiaWallet CSiaWallet;
|
||||
typedef CSiaApi::_CSiaRenter CSiaRenter;
|
||||
typedef CSiaApi::_CSiaConsensus CSiaConsensus;
|
||||
typedef std::shared_ptr<CSiaWallet> CSiaWalletPtr;
|
||||
typedef std::shared_ptr<CSiaRenter> CSiaRenterPtr;
|
||||
typedef std::shared_ptr<CSiaConsensus> CSiaConsensusPtr;
|
||||
typedef CSiaApi::_CSiaFile CSiaFile;
|
||||
typedef std::shared_ptr<CSiaFile> CSiaFilePtr;
|
||||
typedef std::vector<CSiaFilePtr> CSiaFileCollection;
|
||||
|
Reference in New Issue
Block a user