perf: coordinate unknown id lookups

This is a huge improvement over what it was before. Now all unknown id
lookups are debounced and happen through a central coordinator. This
ensures there is no duplication between timelines.

Fixes: https://github.com/damus-io/notedeck/issues/279
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-09-02 17:35:59 -07:00
parent ad244d48c0
commit bc8a8d4a74
7 changed files with 324 additions and 224 deletions

View File

@@ -16,7 +16,7 @@ impl Keypair {
let cloned_secret_key = secret_key.clone();
let nostr_keys = nostr::Keys::new(secret_key);
Keypair {
pubkey: Pubkey::new(&nostr_keys.public_key().to_bytes()),
pubkey: Pubkey::new(nostr_keys.public_key().to_bytes()),
secret_key: Some(cloned_secret_key),
}
}
@@ -61,7 +61,7 @@ impl FullKeypair {
let (xopk, _) = secret_key.x_only_public_key(&nostr::SECP256K1);
let secret_key = nostr::SecretKey::from(*secret_key);
FullKeypair {
pubkey: Pubkey::new(&xopk.serialize()),
pubkey: Pubkey::new(xopk.serialize()),
secret_key,
}
}