aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-01-27 01:24:06 +0100
committerPieter Wuille <pieterw@google.com>2013-01-30 03:56:45 +0100
commit7851033dd687e826df82c1ec841480710468ce8c (patch)
tree1e44c5d08afca9b9f7e72b04bbf77f1857f75476 /src/main.h
parent18379c80874ad6f4fa0e962dd2046e2fa7ecd287 (diff)
downloadbitcoin-7851033dd687e826df82c1ec841480710468ce8c.tar.xz
Improve dealing with abort conditions
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h10
1 files changed, 8 insertions, 2 deletions
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;