Do packet MAC check before locallyValidate(), and add timing measurement in selftest.
This commit is contained in:
parent
1fcbb1fbed
commit
ab4021dd0e
2 changed files with 16 additions and 11 deletions
12
selftest.cpp
12
selftest.cpp
|
@ -376,11 +376,15 @@ static int testIdentity()
|
|||
std::cout << "FAIL (1)" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
if (!id.locallyValidate()) {
|
||||
std::cout << "FAIL (2)" << std::endl;
|
||||
return -1;
|
||||
const uint64_t vst = OSUtils::now();
|
||||
for(int k=0;k<10;++k) {
|
||||
if (!id.locallyValidate()) {
|
||||
std::cout << "FAIL (2)" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
std::cout << "PASS" << std::endl;
|
||||
const uint64_t vet = OSUtils::now();
|
||||
std::cout << "PASS (" << ((double)(vet - vst) / 10.0) << "ms per validation)" << std::endl;
|
||||
|
||||
std::cout << "[identity] Validate known-bad identity... "; std::cout.flush();
|
||||
if (!id.fromString(KNOWN_BAD_IDENTITY)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue