add connection addresses to whitelist

pull/13037/head
Paul Szczeanek 2020-06-03 17:30:21 +01:00
parent bfdbcc7b4a
commit 73b4bebee0
1 changed files with 15 additions and 0 deletions

View File

@ -617,6 +617,21 @@ public:
continue;
}
// Add the connection address
whitelist->addresses[whitelist->size].address = flags->peer_address.data();
if (flags->peer_address_is_public) {
whitelist->addresses[whitelist->size].type = peer_address_type_t::PUBLIC;
} else {
whitelist->addresses[whitelist->size].type = peer_address_type_t::RANDOM;
}
whitelist->size++;
if (whitelist->size == whitelist->capacity) {
break;
}
// Add the identity address
SecurityEntryIdentity_t* identity = read_in_entry_peer_identity(db_handle);
if (!identity) {
continue;