5 #ifndef RAVEN_ASSETDB_H 6 #define RAVEN_ASSETDB_H 34 template <
typename Stream,
typename Operation>
40 if (ser_action.ForRead()) {
41 if (!s.empty() and s.size() >= 1) {
49 version = nVersionCheck;
63 explicit CAssetsDB(
size_t nCacheSize,
bool fMemory =
false,
bool fWipe =
false);
69 bool WriteAssetData(
const CNewAsset& asset,
const int nHeight,
const uint256& blockHash);
70 bool WriteAssetAddressQuantity(
const std::string& assetName,
const std::string& address,
const CAmount& quantity);
71 bool WriteAddressAssetQuantity(
const std::string& address,
const std::string& assetName,
const CAmount& quantity);
72 bool WriteBlockUndoAssetData(
const uint256& blockhash,
const std::vector<std::pair<std::string, CBlockAssetUndo> >& assetUndoData);
73 bool WriteReissuedMempoolState();
76 bool ReadAssetData(
const std::string& strName,
CNewAsset& asset,
int& nHeight,
uint256& blockHash);
77 bool ReadAssetAddressQuantity(
const std::string& assetName,
const std::string& address,
CAmount& quantity);
78 bool ReadAddressAssetQuantity(
const std::string& address,
const std::string& assetName,
CAmount& quantity);
79 bool ReadBlockUndoAssetData(
const uint256& blockhash, std::vector<std::pair<std::string, CBlockAssetUndo> >& assetUndoData);
80 bool ReadReissuedMempoolState();
83 bool EraseAssetData(
const std::string& assetName);
84 bool EraseMyAssetData(
const std::string& assetName);
85 bool EraseAssetAddressQuantity(
const std::string &assetName,
const std::string &address);
90 bool AssetDir(std::vector<CDatabasedAssetData>& assets,
const std::string filter,
const size_t count,
const long start);
91 bool AssetDir(std::vector<CDatabasedAssetData>& assets);
93 bool AddressDir(std::vector<std::pair<std::string, CAmount> >& vecAssetAmount,
int& totalEntries,
const bool& fGetTotal,
const std::string& address,
const size_t count,
const long start);
94 bool AssetAddressDir(std::vector<std::pair<std::string, CAmount> >& vecAddressAmount,
int& totalEntries,
const bool& fGetTotal,
const std::string& assetName,
const size_t count,
const long start);
98 #endif //RAVEN_ASSETDB_H
bool EraseAddressAssetQuantity(const std::string &address, const std::string &assetName)
void Serialize(Stream &s, char a)
int64_t CAmount
Amount in corbies (Can be negative)
An outpoint - a combination of a transaction hash and an index n into its vout.
bool fChangedVerifierString
std::string verifierString
void SerializationOp(Stream &s, Operation ser_action)
void Unserialize(Stream &s, char &a)
const int8_t ASSET_UNDO_INCLUDES_VERIFIER_STRING
Access to the block database (blocks/index/)