aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-10-02 08:35:12 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-10-02 08:44:08 +0200
commit00eef5d6e9b08b173492599ec41c7feb445e2139 (patch)
tree28fd5f16cb04d75045f784288d4d64683f4393a5
parent90aa73e900e3ca944cf2373d4e0504d3a9efb697 (diff)
parentf74fc9b22d7f39e36d0cbf80f5c06958c516c8ec (diff)
downloadbitcoin-00eef5d6e9b08b173492599ec41c7feb445e2139.tar.xz
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)
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 32393e5e03..a3e36ff872 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,6 +17,7 @@
#include "txmempool.h"
#include "ui_interface.h"
#include "util.h"
+#include "utilmoneystr.h"
#include <sstream>
@@ -1316,7 +1317,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
bool CScriptCheck::operator()() const {
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
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;
}
@@ -1361,7 +1362,8 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
}
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");
// Tally transaction fees