Beispiel #1
0
std::pair<bool, std::string> STTx::checkSign(bool allowMultiSign) const
{
    std::pair<bool, std::string> ret {false, ""};
    try
    {
        if (allowMultiSign)
        {
            // Determine whether we're single- or multi-signing by looking
            // at the SigningPubKey.  It it's empty we must be
            // multi-signing.  Otherwise we're single-signing.
            Blob const& signingPubKey = getFieldVL (sfSigningPubKey);
            ret = signingPubKey.empty () ?
                checkMultiSign () : checkSingleSign ();
        }
        else
        {
            ret = checkSingleSign ();
        }
    }
    catch (std::exception const&)
    {
        ret = {false, "Internal signature check failure."};
    }
    return ret;
}
Beispiel #2
0
NotTEC
Transactor::checkSign (PreclaimContext const& ctx)
{
    // Make sure multisigning is enabled before we check for multisignatures.
    if (ctx.view.rules().enabled(featureMultiSign))
    {
        // If the pk is empty, then we must be multi-signing.
        if (ctx.tx.getSigningPubKey().empty ())
            return checkMultiSign (ctx);
    }

    return checkSingleSign (ctx);
}
Beispiel #3
0
bool STTx::checkSign(bool allowMultiSign) const
{
    bool sigGood = false;
    try
    {
        if (allowMultiSign)
        {
            // Determine whether we're single- or multi-signing by looking
            // at the SigningPubKey.  It it's empty we must be
            // multi-signing.  Otherwise we're single-signing.
            Blob const& signingPubKey = getFieldVL (sfSigningPubKey);
            sigGood = signingPubKey.empty () ?
                checkMultiSign () : checkSingleSign ();
        }
        else
        {
            sigGood = checkSingleSign ();
        }
    }
    catch (...)
    {
    }
    return sigGood;
}