docs: update store_self_keypair() documentation

Since migration 107 there is no addr column in `keypairs` table.
This commit is contained in:
link2xt
2026-02-24 20:12:56 +00:00
committed by l
parent c39651a8d4
commit 2511b03726

View File

@@ -346,18 +346,11 @@ pub(crate) async fn load_keypair(context: &Context) -> Result<Option<KeyPair>> {
Ok(signed_secret_key.map(KeyPair::new))
}
/// Store the keypair as an owned keypair for addr in the database.
/// Stores own keypair in the database and sets it as a default.
///
/// This will save the keypair as keys for the given address. The
/// "self" here refers to the fact that this DC instance owns the
/// keypair. Usually `addr` will be [Config::ConfiguredAddr].
///
/// If either the public or private keys are already present in the
/// database, this entry will be removed first regardless of the
/// address associated with it. Practically this means saving the
/// same key again overwrites it.
///
/// [Config::ConfiguredAddr]: crate::config::Config::ConfiguredAddr
/// Fails if we already have a key, so it is not possible to
/// have more than one key for new setups. Existing setups
/// may still have more than one key for compatibility.
pub(crate) async fn store_self_keypair(context: &Context, keypair: &KeyPair) -> Result<()> {
let mut config_cache_lock = context.sql.config_cache.write().await;
let new_key_id = context