Use UPSERT when saving peerstates

This way there is no need to distinguish between creating
and updating peerstate.
This commit is contained in:
link2xt
2022-11-25 22:22:29 +00:00
parent 62f92d5b28
commit c7691fbebe
8 changed files with 43 additions and 54 deletions

View File

@@ -280,7 +280,7 @@ impl Sql {
for addr in &addrs {
if let Some(ref mut peerstate) = Peerstate::from_addr(context, addr).await? {
peerstate.recalc_fingerprint();
peerstate.save_to_db(self, false).await?;
peerstate.save_to_db(self).await?;
}
}
}