Support for error messages and a few more rejection reasons

This commit is contained in:
Luke Dashjr
2012-09-10 02:02:35 +00:00
parent 14e7ffcc64
commit c117d9e93a
2 changed files with 12 additions and 10 deletions

View File

@@ -950,13 +950,15 @@ public:
unsigned char _chRejectCode=0, std::string _strRejectReason="") {
return DoS(0, ret, _chRejectCode, _strRejectReason);
}
bool Error() {
bool Error(std::string strRejectReasonIn="") {
if (mode == MODE_VALID)
strRejectReason = strRejectReasonIn;
mode = MODE_ERROR;
return false;
}
bool Abort(const std::string &msg) {
AbortNode(msg);
return Error();
return Error(msg);
}
bool IsValid() {
return mode == MODE_VALID;