@ -28,12 +28,12 @@ private:
} mode ;
} mode ;
int nDoS ;
int nDoS ;
std : : string strRejectReason ;
std : : string strRejectReason ;
unsigned char chRejectCode ;
unsigned int chRejectCode ;
bool corruptionPossible ;
bool corruptionPossible ;
public :
public :
CValidationState ( ) : mode ( MODE_VALID ) , nDoS ( 0 ) , chRejectCode ( 0 ) , corruptionPossible ( false ) { }
CValidationState ( ) : mode ( MODE_VALID ) , nDoS ( 0 ) , chRejectCode ( 0 ) , corruptionPossible ( false ) { }
bool DoS ( int level , bool ret = false ,
bool DoS ( int level , bool ret = false ,
unsigned char chRejectCodeIn = 0 , std : : string strRejectReasonIn = " " ,
unsigned int chRejectCodeIn = 0 , std : : string strRejectReasonIn = " " ,
bool corruptionIn = false ) {
bool corruptionIn = false ) {
chRejectCode = chRejectCodeIn ;
chRejectCode = chRejectCodeIn ;
strRejectReason = strRejectReasonIn ;
strRejectReason = strRejectReasonIn ;
@ -45,7 +45,7 @@ public:
return ret ;
return ret ;
}
}
bool Invalid ( bool ret = false ,
bool Invalid ( bool ret = false ,
unsigned char _chRejectCode = 0 , std : : string _strRejectReason = " " ) {
unsigned int _chRejectCode = 0 , std : : string _strRejectReason = " " ) {
return DoS ( 0 , ret , _chRejectCode , _strRejectReason ) ;
return DoS ( 0 , ret , _chRejectCode , _strRejectReason ) ;
}
}
bool Error ( const std : : string & strRejectReasonIn ) {
bool Error ( const std : : string & strRejectReasonIn ) {
@ -73,7 +73,7 @@ public:
bool CorruptionPossible ( ) const {
bool CorruptionPossible ( ) const {
return corruptionPossible ;
return corruptionPossible ;
}
}
unsigned char GetRejectCode ( ) const { return chRejectCode ; }
unsigned int GetRejectCode ( ) const { return chRejectCode ; }
std : : string GetRejectReason ( ) const { return strRejectReason ; }
std : : string GetRejectReason ( ) const { return strRejectReason ; }
} ;
} ;