Skip to content

Commit e99c765

Browse files
committed
add log for keychain compaction time cost
1 parent 2e2d1a6 commit e99c765

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

mutiny-core/src/nodemanager.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ impl<S: MutinyStorage> NodeManager<S> {
696696
}
697697

698698
// check keychain size
699+
let start = Instant::now();
699700
let changes = match nm.storage.read_changes() {
700701
Ok(Some(c)) => c,
701702
Ok(None) => ChangeSet::default(),
@@ -729,7 +730,7 @@ impl<S: MutinyStorage> NodeManager<S> {
729730
.is_ok()
730731
{
731732
if let Ok(mut wallet) = nm.wallet.wallet.try_write() {
732-
if let Some(changeset) = wallet.take_staged() {
733+
if let Some(changeset) = new_wallet.take_staged() {
733734
if nm.storage.restore_changes(&changeset).is_ok() {
734735
*wallet = new_wallet;
735736
log_info!(
@@ -748,6 +749,11 @@ impl<S: MutinyStorage> NodeManager<S> {
748749
}
749750
}
750751
}
752+
log_info!(
753+
nm.logger,
754+
"Keychain compaction took {} seconds",
755+
start.elapsed().as_secs()
756+
);
751757

752758
// wait for next sync round, checking graceful shutdown check each second.
753759
if !did_keychain_compact_this_round {

0 commit comments

Comments
 (0)