on some call sites: peerstate.save_to_db() should bubble up errors instead of crashing.

also write a test that double-creation of an addr-row is fine.
This commit is contained in:
holger krekel
2019-10-01 00:20:08 +02:00
committed by Floris Bruynooghe
parent 22d2097132
commit ee6d16f1b1
4 changed files with 45 additions and 10 deletions

View File

@@ -794,7 +794,7 @@ fn open(
if let Some(ref mut peerstate) = Peerstate::from_addr(context, sql, &addr?)
{
peerstate.recalc_fingerprint();
peerstate.save_to_db(sql, false).unwrap();
peerstate.save_to_db(sql, false)?;
}
}
Ok(())