Ejemplo n.º 1
0
static std::string ScriptToString(const CScript& script, bool l = false, bool highlight = false)
{
    if (script.empty())
        return "unknown";

    CTxDestination dest;
    if (ExtractDestination(script, dest)) {
        if (highlight)
            return "<span class=\"addr\">" + EncodeDestination(dest) + "</span>";
        else
            return makeHRef(EncodeDestination(dest));
    } else
        return l ? "<pre>" + FormatScript(script) + "</pre>" : _("Non-standard script");
}
Ejemplo n.º 2
0
static std::string ScriptToString(const CScript& Script, bool Long = false, bool Highlight = false)
{
    if (Script.empty())
        return "unknown";

    CTxDestination Dest;
    CBitcoinAddress Address;
    if (ExtractDestination(Script, Dest) && Address.Set(Dest)) {
        if (Highlight)
            return "<span class=\"addr\">" + Address.ToString() + "</span>";
        else
            return makeHRef(Address.ToString());
    } else
        return Long ? "<pre>" + FormatScript(Script) + "</pre>" : _("Non-standard script");
}