From: 志宇 Date: Tue, 10 Dec 2024 11:53:12 +0000 (+1100) Subject: chore: Fix typos X-Git-Tag: v1.0.0-beta.6~2^2~1 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/mnemonic/static/gitweb.css?a=commitdiff_plain;h=1508ae3db4b0595e61136d4d28e10777c92a7273;p=bdk chore: Fix typos --- diff --git a/crates/chain/src/canonical_iter.rs b/crates/chain/src/canonical_iter.rs index 6a12bbf2..99550ab7 100644 --- a/crates/chain/src/canonical_iter.rs +++ b/crates/chain/src/canonical_iter.rs @@ -87,7 +87,7 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> { Ok(()) } - /// Marks a transaction and it's ancestors as canoncial. Mark all conflicts of these as + /// Marks a transaction and it's ancestors as canonical. Mark all conflicts of these as /// `not_canonical`. fn mark_canonical(&mut self, txid: Txid, tx: Arc, reason: CanonicalReason) { let starting_txid = txid; diff --git a/docs/adr/0003_canonicalization_algorithm.md b/docs/adr/0003_canonicalization_algorithm.md index 503e857e..c3062cbc 100644 --- a/docs/adr/0003_canonicalization_algorithm.md +++ b/docs/adr/0003_canonicalization_algorithm.md @@ -62,9 +62,9 @@ The algorithm's premise is as follows: 5. A transaction with a higher last-seen has precedence. 6. Last-seen values are transitive. A transaction's real last-seen value is the max between it's last-seen value all of it's descendants. -Like Option 3's algorithm, we maintain two mutually-exclusive `txid` sets: `canoncial` and `not_canonical`. +Like Option 3's algorithm, we maintain two mutually-exclusive `txid` sets: `canonical` and `not_canonical`. -Imagine a method `mark_canonical(A)` that is based on premise 1 and 2. This method will mark transaction `A` and all of it's ancestors as canonical. For each transaction that is marked canonical, we can iterate all of it's conflicts and mark those as `non_canonical`. If a transaction already exists in `canoncial` or `not_canonical`, we can break early, avoiding duplicate work. +Imagine a method `mark_canonical(A)` that is based on premise 1 and 2. This method will mark transaction `A` and all of it's ancestors as canonical. For each transaction that is marked canonical, we can iterate all of it's conflicts and mark those as `non_canonical`. If a transaction already exists in `canonical` or `not_canonical`, we can break early, avoiding duplicate work. This algorithm iterates transactions in 3 runs.