Function to get list of features supported by ledger.

This commit is contained in:
JoelKatz
2013-05-30 13:44:18 -07:00
parent 45c117bf91
commit a38e80eb6b
2 changed files with 14 additions and 0 deletions

View File

@@ -1327,6 +1327,18 @@ std::vector< std::pair<uint32, uint256> > Ledger::getLedgerHashes()
return ret;
}
boost::unordered_set<uint256> Ledger::getLedgerFeatures()
{
boost::unordered_set<uint256> usFeatures;
SLE::pointer sleFeatures = getSLEi(getLedgerFeatureIndex());
if (sleFeatures)
{
BOOST_FOREACH(const uint256& uFeature, sleFeatures->getFieldV256(sfFeatures).peekValue())
usFeatures.insert(uFeature);
}
return usFeatures;
}
// XRP to XRP not allowed.
// Currencies must have appropriate issuer.
// Currencies or accounts must differ.

View File

@@ -5,6 +5,7 @@
#include <list>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_set.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
@@ -219,6 +220,7 @@ public:
static uint256 getLedgerFeatureIndex();
static uint256 getLedgerFeeIndex();
boost::unordered_set<uint256> getLedgerFeatures();
std::vector<uint256> getNeededTransactionHashes(int max, SHAMapSyncFilter* filter);
std::vector<uint256> getNeededAccountStateHashes(int max, SHAMapSyncFilter* filter);