Remove dead code
This commit is contained in:
@@ -47,23 +47,6 @@
|
||||
#define SATOSHIDEN ((uint64_t)100000000L)
|
||||
#define dstr(x) ((double)(x) / SATOSHIDEN)
|
||||
#define CCDISABLEALL memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES))
|
||||
#define CCENABLE(x) ASSETCHAINS_CCDISABLES[((uint8_t)x)] = 0
|
||||
|
||||
/// identifiers of additional data blobs in token opreturn script:
|
||||
/// @see EncodeTokenCreateOpRet(uint8_t funcid, std::vector<uint8_t> origpubkey, std::string name, std::string description, std::vector<std::pair<uint8_t, vscript_t>> oprets)
|
||||
/// @see GetOpretBlob
|
||||
|
||||
/// finds opret blob data by opretid in the vector of oprets
|
||||
/// @param oprets vector of oprets
|
||||
/// @param id opret id to search
|
||||
/// @param vopret found opret blob as byte array
|
||||
/// @returns true if found
|
||||
/// @see opretid
|
||||
inline bool GetOpretBlob(const std::vector<std::pair<uint8_t, std::vector<uint8_t>>> &oprets, uint8_t id, std::vector<uint8_t> &vopret) {
|
||||
vopret.clear();
|
||||
for(auto p : oprets) if (p.first == id) { vopret = p.second; return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
/// \cond INTERNAL
|
||||
struct CC_utxo
|
||||
@@ -610,60 +593,4 @@ inline std::string STR_TOLOWER(const std::string &str) { std::string out; for (s
|
||||
void AddSigData2UniValue(UniValue &result, int32_t vini, UniValue& ccjson, std::string sscriptpubkey, int64_t amount);
|
||||
|
||||
|
||||
#ifndef LOGSTREAM_DEFINED
|
||||
#define LOGSTREAM_DEFINED
|
||||
// bitcoin LogPrintStr with category "-debug" cmdarg support for C++ ostringstream:
|
||||
|
||||
// log levels:
|
||||
#define CCLOG_ERROR (-1) //!< error level
|
||||
#define CCLOG_INFO 0 //!< info level
|
||||
#define CCLOG_DEBUG1 1 //!< debug level 1
|
||||
#define CCLOG_DEBUG2 2 //!< debug level 2
|
||||
#define CCLOG_DEBUG3 3 //!< debug level 3
|
||||
#define CCLOG_MAXLEVEL 3
|
||||
|
||||
/// @private
|
||||
extern void CCLogPrintStr(const char *category, int level, const std::string &str);
|
||||
|
||||
/// @private
|
||||
template <class T>
|
||||
void CCLogPrintStream(const char *category, int level, const char *functionName, T print_to_stream)
|
||||
{
|
||||
}
|
||||
/// Macro for logging messages using bitcoin LogAcceptCategory and LogPrintStr functions.
|
||||
/// Supports error, info and three levels of debug messages.
|
||||
/// Logging category is set by -debug=category hushd param.
|
||||
/// To set debug level pass -debug=category-1, -debug=category-2 or -debug=category-3 param. If some level is enabled lower level messages also will be printed.
|
||||
/// To print info-level messages pass just -debug=category parameter, with no level.
|
||||
/// Error-level messages will always be printed, even if -debug parameter is not set
|
||||
/// @param category category of message, for example Antara module name
|
||||
/// @param level debug-level, use defines CCLOG_ERROR, CCLOG_INFO, CCLOG_DEBUGN
|
||||
/// @param logoperator to form the log message (the 'stream' name is mandatory)
|
||||
/// usage: LOGSTREAM("category", debug-level, stream << "some log data" << data2 << data3 << ... << std::endl);
|
||||
/// example: LOGSTREAM("heir", CCLOG_INFO, stream << "heir public key is " << HexStr(heirPk) << std::endl);
|
||||
#define LOGSTREAM(category, level, logoperator) CCLogPrintStream( category, level, NULL, [=](std::ostringstream &stream) {logoperator;} )
|
||||
|
||||
/// LOGSTREAMFN is a version of LOGSTREAM macro which adds calling function name with the standard define \_\_func\_\_ at the beginning of the printed string.
|
||||
/// LOGSTREAMFN parameters are the same as in LOGSTREAM
|
||||
/// @see LOGSTREAM
|
||||
#define LOGSTREAMFN(category, level, logoperator) CCLogPrintStream( category, level, __func__, [=](std::ostringstream &stream) {logoperator;} )
|
||||
|
||||
/// @private
|
||||
template <class T>
|
||||
UniValue report_ccerror(const char *category, int level, T print_to_stream)
|
||||
{
|
||||
UniValue err(UniValue::VOBJ);
|
||||
std::ostringstream stream;
|
||||
|
||||
print_to_stream(stream);
|
||||
err.push_back(Pair("result", "error"));
|
||||
err.push_back(Pair("error", stream.str()));
|
||||
stream << std::endl;
|
||||
CCLogPrintStr(category, level, stream.str());
|
||||
return err;
|
||||
}
|
||||
|
||||
/// @private
|
||||
#define CCERR_RESULT(category,level,logoperator) return report_ccerror(category, level, [=](std::ostringstream &stream) {logoperator;})
|
||||
#endif // #ifndef LOGSTREAM_DEFINED
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,3 @@ CPubKey pubkey2pk(std::vector<uint8_t> vpubkey)
|
||||
pk.Set(vpubkey.begin(), vpubkey.end());
|
||||
return(pk);
|
||||
}
|
||||
|
||||
void CCLogPrintStr(const char *category, int level, const std::string &str)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user