mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 23:07:52 +00:00
test invalid userhash (might be an invalid tx received from network)
This commit is contained in:
parent
d9fdca340c
commit
a6ff5511fa
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user