Improve error message when signing fails (RIPD-1066):

With the addition of multisigning there are a variety of reasons
a signature may fail.  We now return a more descriptive message
for the reason certain signature checks fail.
This commit is contained in:
Scott Schurr
2016-01-07 16:10:14 -08:00
committed by Nik Bougalis
parent ed9f5639a8
commit 2eaf211e9b
6 changed files with 178 additions and 70 deletions

View File

@@ -88,14 +88,17 @@ preflight1 (PreflightContext const& ctx)
TER
preflight2 (PreflightContext const& ctx)
{
if(!( ctx.flags & tapNO_CHECK_SIGN) &&
checkValidity(ctx.app.getHashRouter(),
ctx.tx, ctx.rules, ctx.app.config()).first == Validity::SigBad)
if(!( ctx.flags & tapNO_CHECK_SIGN))
{
JLOG(ctx.j.debug) << "preflight2: bad signature";
return temINVALID;
auto const sigValid = checkValidity(ctx.app.getHashRouter(),
ctx.tx, ctx.rules, ctx.app.config());
if (sigValid.first == Validity::SigBad)
{
JLOG(ctx.j.debug) <<
"preflight2: bad signature. " << sigValid.second;
return temINVALID;
}
}
return tesSUCCESS;
}