5 #include <validation.h> 31 return (int8_t)status;
48 default:
return "ERROR";
193 LogPrintf(
"%s : Start Scanning For Message Channels\n", __func__);
196 strError =
"Wallet isn't active on this client. Can't scan for MsgChannels";
205 strError =
"Block not found on disk";
209 for (
const auto& tx : block.
vtx) {
213 strError =
"Failed to get transaction pointer";
217 for (
auto out : ptx->vout) {
221 if (
out.scriptPubKey.IsAssetScript(nType, fOwner)) {
250 LogPrintf(
"%s : Failed to get GetAssetData call\n", __func__);
259 LogPrintf(
"%s : Finished Scanning For Message Channels. Subscribed Messages Channels Found: %u\n", __func__,
setDirtyChannelsAdd.size());
335 std::string str =
"";
337 str +=
"\"blockheight\": " + std::to_string(this->blockHeight) +
", ";
338 str +=
"\"assetname\": \"" + this->assetName +
"\", ";
340 str +=
"\"expiretime\": " + std::to_string(this->nExpireTime);
std::set< COutPoint > setDirtyMessagesRemove
void AddChannel(const std::string &name)
bool GetMessage(const COutPoint &out, CMessage &message)
size_t GetMessageDirtyCacheSize()
std::string ToSerializedString() const
CMessageChannelDB * pmessagechanneldb
Global variable that points to the message channel database (protected by cs_main) ...
CCriticalSection cs_main
Global state.
std::string createJsonString()
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
std::vector< CWalletRef > vpwallets
bool ReadMyMessageChannel(const std::string &channelname)
CLRUCache< std::string, int > * pMessageSubscribedChannelsCache
Global variable that points to the subscribed channel LRU Cache (protected by cs_main) ...
bool GetAssetData(const CScript &script, CAssetOutputEntry &data)
bool IsAddressSeen(const std::string &address)
CLRUCache< std::string, CMessage > * pMessagesCache
Global variable that points to the subscribed channel LRU Cache (protected by cs_main) ...
bool ReadMessage(const COutPoint &out, CMessage &message)
std::set< std::string > setDirtyChannelsRemove
bool IsAssetNameValid(const std::string &name, AssetType &assetType, std::string &error)
std::set< std::string > setSubscribedChannelsAskedForFalse
CMessageDB * pmessagedb
Global variable that points to the messages database (protected by cs_main)
std::set< std::string > setAddressAskedForFalse
std::map< COutPoint, CMessage > mapDirtyMessagesOrphaned
CCriticalSection cs_messaging
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
An outpoint - a combination of a transaction hash and an index n into its vout.
void RemoveMessage(const CMessage &message)
std::map< COutPoint, CMessage > mapDirtyMessagesAdd
void AddAddressSeen(const std::string &address)
int8_t IntFromMessageStatus(MessageStatus status)
int GetAssetActivationHeight() const
std::vector< CTransactionRef > vtx
std::string EncodeDestination(const CTxDestination &dest)
bool ScanForMessageChannels(std::string &strError)
std::string MessageStatusToString(MessageStatus status)
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
void AddMessage(const CMessage &message)
void OrphanMessage(const COutPoint &out)
std::set< std::string > setDirtyChannelsAdd
MessageStatus MessageStatusFromInt(int8_t nStatus)
int nHeight
height of the entry in the chain. The genesis block has height 0
bool ReadBlockFromDisk(CBlock &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams)
Functions for disk access for blocks.
CTxDestination destination
void RemoveChannel(const std::string &name)
std::string EncodeAssetData(std::string decoded)
CLRUCache< std::string, int > * pMessagesSeenAddressCache
Global variable that points to the address seen LRU Cache (protected by cs_main)
Wrapped boost mutex: supports recursive locking, but no waiting TODO: We should move away from using ...
bool ReadUsedAddress(const std::string &address)
bool IsChannelSubscribed(const std::string &name)
std::set< std::string > setDirtySeenAddressAdd