Skip to content

Commit 6235f15

Browse files
committed
refactor(key-wallet): drop WalletInfoInterface::set_birth_height
The setter only updated `birth_height`, leaving `synced_height` and `last_processed_height` at their previous values, so a caller using it after construction would silently bypass the seeding invariant established by `from_wallet`. With the per-wallet height tracking in #694 that aggregate to a min/max across wallets, this could drag the manager's `synced_height` back to genesis. After the constructor change, the setter has zero callers in-tree, so removing it is the cleanest way to enforce the invariant: `birth_height` is fixed at construction via `from_wallet`. Addresses CodeRabbit review comment on PR #692 #692 (comment)
1 parent 0fa8a19 commit 6235f15

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ pub trait WalletInfoInterface: Sized + WalletTransactionChecker + ManagedAccount
5252
/// Get the birth height of the wallet
5353
fn birth_height(&self) -> CoreBlockHeight;
5454

55-
/// Set the birth height
56-
fn set_birth_height(&mut self, height: CoreBlockHeight);
57-
5855
/// Get the timestamp when first loaded
5956
fn first_loaded_at(&self) -> u64;
6057

@@ -166,10 +163,6 @@ impl WalletInfoInterface for ManagedWalletInfo {
166163
self.metadata.birth_height
167164
}
168165

169-
fn set_birth_height(&mut self, height: CoreBlockHeight) {
170-
self.metadata.birth_height = height;
171-
}
172-
173166
fn last_processed_height(&self) -> CoreBlockHeight {
174167
self.metadata.last_processed_height
175168
}

0 commit comments

Comments
 (0)