From 7851033dd687e826df82c1ec841480710468ce8c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 27 Jan 2013 01:24:06 +0100 Subject: Improve dealing with abort conditions --- src/main.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index 9c2029c9b7..8498fc2edd 100644 --- a/src/main.h +++ b/src/main.h @@ -181,6 +181,8 @@ bool ConnectBestBlock(CValidationState &state); CBlockIndex * InsertBlockIndex(uint256 hash); /** Verify a signature */ bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); +/** Abort with a message */ +bool AbortNode(const std::string &msg); @@ -1886,9 +1888,13 @@ public: bool Invalid(bool ret = false) { return DoS(0, ret); } - bool Error(bool ret = false) { + bool Error() { mode = MODE_ERROR; - return ret; + return false; + } + bool Abort(const std::string &msg) { + AbortNode(msg); + return Error(); } bool IsValid() { return mode == MODE_VALID; -- cgit v1.2.3