diff --git a/src/core.cpp b/src/core.cpp index 93d2cb59..21f07582 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -84,7 +84,7 @@ uint256 CTransaction::GetUsernameHash() const return SerializeHash(userName.ExtractSmallString()); } // [MF] TODO: remove this assert later, it will fail for spammessage. - assert(!"username not small string"); + //assert(!"username not small string"); return uint256(); } diff --git a/src/main.cpp b/src/main.cpp index ad48664c..e72e38d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -494,6 +494,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) return state.DoS(10, error("CheckTransaction() : pubKey empty")); if (!tx.userName.IsSmallString()) return state.DoS(10, error("CheckTransaction() : username not smallstring")); + if (tx.GetUsernameHash() == uint256()) + return state.DoS(10, error("CheckTransaction() : username hash error")); if (!CheckUsername( tx.userName.ExtractSmallString(), state )) return state.DoS(10, error("CheckTransaction() : username check failed")); }