@@ -471,6 +471,7 @@ pub struct WalletSummary<AccountId: Eq + Hash> {
471
471
chain_tip_height : BlockHeight ,
472
472
fully_scanned_height : BlockHeight ,
473
473
scan_progress : Option < Ratio < u64 > > ,
474
+ recovery_progress : Option < Ratio < u64 > > ,
474
475
next_sapling_subtree_index : u64 ,
475
476
#[ cfg( feature = "orchard" ) ]
476
477
next_orchard_subtree_index : u64 ,
@@ -483,6 +484,7 @@ impl<AccountId: Eq + Hash> WalletSummary<AccountId> {
483
484
chain_tip_height : BlockHeight ,
484
485
fully_scanned_height : BlockHeight ,
485
486
scan_progress : Option < Ratio < u64 > > ,
487
+ recovery_progress : Option < Ratio < u64 > > ,
486
488
next_sapling_subtree_index : u64 ,
487
489
#[ cfg( feature = "orchard" ) ] next_orchard_subtree_index : u64 ,
488
490
) -> Self {
@@ -491,6 +493,7 @@ impl<AccountId: Eq + Hash> WalletSummary<AccountId> {
491
493
chain_tip_height,
492
494
fully_scanned_height,
493
495
scan_progress,
496
+ recovery_progress,
494
497
next_sapling_subtree_index,
495
498
#[ cfg( feature = "orchard" ) ]
496
499
next_orchard_subtree_index,
@@ -513,16 +516,47 @@ impl<AccountId: Eq + Hash> WalletSummary<AccountId> {
513
516
self . fully_scanned_height
514
517
}
515
518
516
- /// Returns the progress of scanning shielded outputs, in terms of the ratio between notes
517
- /// scanned and the total number of notes added to the chain since the wallet birthday.
519
+ /// Returns the progress of scanning the chain to bring the wallet up to date.
518
520
///
519
- /// This ratio should only be used to compute progress percentages, and the numerator and
520
- /// denominator should not be treated as authoritative note counts. Returns `None` if the
521
- /// wallet is unable to determine the size of the note commitment tree.
521
+ /// This progress metric is intended as an indicator of how close the wallet is to
522
+ /// general usability, including the ability to spend existing funds that were
523
+ /// previously spendable.
524
+ ///
525
+ /// The window over which progress is computed spans from the wallet's recovery height
526
+ /// to the current chain tip. This may be adjusted in future updates to better match
527
+ /// the intended semantics.
528
+ ///
529
+ /// Progress is represented in terms of the ratio between notes scanned and the total
530
+ /// number of notes added to the chain in the relevant window. This ratio should only
531
+ /// be used to compute progress percentages, and the numerator and denominator should
532
+ /// not be treated as authoritative note counts.
533
+ ///
534
+ /// Returns `None` if the wallet is unable to determine the size of the note
535
+ /// commitment tree.
522
536
pub fn scan_progress ( & self ) -> Option < Ratio < u64 > > {
523
537
self . scan_progress
524
538
}
525
539
540
+ /// Returns the progress of recovering the wallet from seed.
541
+ ///
542
+ /// This progress metric is intended as an indicator of how close the wallet is to
543
+ /// having a complete history.
544
+ ///
545
+ /// The window over which progress is computed spans from the wallet birthday to the
546
+ /// wallet's recovery height. This may be adjusted in future updates to better match
547
+ /// the intended semantics.
548
+ ///
549
+ /// Progress is represented in terms of the ratio between notes scanned and the total
550
+ /// number of notes added to the chain in the relevant window. This ratio should only
551
+ /// be used to compute progress percentages, and the numerator and denominator should
552
+ /// not be treated as authoritative note counts.
553
+ ///
554
+ /// Returns `None` if the wallet is unable to determine the size of the note
555
+ /// commitment tree.
556
+ pub fn recovery_progress ( & self ) -> Option < Ratio < u64 > > {
557
+ self . recovery_progress
558
+ }
559
+
526
560
/// Returns the Sapling subtree index that should start the next range of subtree
527
561
/// roots passed to [`WalletCommitmentTrees::put_sapling_subtree_roots`].
528
562
pub fn next_sapling_subtree_index ( & self ) -> u64 {
0 commit comments