Improve dealing with abort conditions

This commit is contained in:
Pieter Wuille
2013-01-27 01:24:06 +01:00
committed by Pieter Wuille
parent 18379c8087
commit 7851033dd6
2 changed files with 42 additions and 37 deletions

View File

@@ -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;