Browse Source

Merge pull request #5017

f74fc9b Print input index when signature validation fails, to aid debugging. (Mark Friedenbach)
217a5c9 When transaction outputs exceed inputs, show the offending amounts so as to aid debugging. (Mark Friedenbach)
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
00eef5d6e9
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/main.cpp

6
src/main.cpp

@ -17,6 +17,7 @@
#include "txmempool.h" #include "txmempool.h"
#include "ui_interface.h" #include "ui_interface.h"
#include "util.h" #include "util.h"
#include "utilmoneystr.h"
#include <sstream> #include <sstream>
@ -1316,7 +1317,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
bool CScriptCheck::operator()() const { bool CScriptCheck::operator()() const {
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags)) if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags))
return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString()); return error("CScriptCheck() : %s:%d VerifySignature failed", ptxTo->GetHash().ToString(), nIn);
return true; return true;
} }
@ -1361,7 +1362,8 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
} }
if (nValueIn < tx.GetValueOut()) if (nValueIn < tx.GetValueOut())
return state.DoS(100, error("CheckInputs() : %s value in < value out", tx.GetHash().ToString()), return state.DoS(100, error("CheckInputs() : %s value in (%s) < value out (%s)",
tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut())),
REJECT_INVALID, "bad-txns-in-belowout"); REJECT_INVALID, "bad-txns-in-belowout");
// Tally transaction fees // Tally transaction fees

Loading…
Cancel
Save