Skip to content

Commit

Permalink
Merged PR 175: Raise default/minimum birthday height for account restore
Browse files Browse the repository at this point in the history
Raise default/minimum birthday height for account restore

Due to zcash/librustzcash#1467, restoring an account from sapling activation height (+0 or +1) fails. But since the underlying bug is related to the fact that no sapling commitment tree had started until +2, we can safely just raise the minimum restore height by +2 so users can restore their accounts with the default minimum height
  • Loading branch information
AArnott committed Aug 30, 2024
2 parents 77c6b1c + 98d0d27 commit c31d9e7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ImportAccountViewModel(IViewModelServices viewModelServices)
this.LinkProperty(nameof(this.SeedPassword), nameof(this.SeedPasswordHasWhitespace));
this.LinkProperty(nameof(this.IsTestNet), nameof(this.MinimumBirthdayHeight));

this.BirthdayHeight = this.NetworkParameters.SaplingActivationHeight;
this.BirthdayHeight = this.MinimumBirthdayHeight;

if (viewModelServices.Wallet.IsEmpty)
{
Expand Down Expand Up @@ -153,7 +153,7 @@ public uint? BirthdayHeight

public string BirthdayHeightCaption => ImportAccountStrings.BirthdayHeightCaption;

public ulong MinimumBirthdayHeight => this.NetworkParameters.SaplingActivationHeight;
public uint MinimumBirthdayHeight => (uint)(this.NetworkParameters.SaplingActivationHeight + (this.IsTestNet ? 0 : 2)); // workaround https://github.com/zcash/librustzcash/issues/1467

public string ImportCommandCaption => ImportAccountStrings.ImportCommandCaption;

Expand Down

0 comments on commit c31d9e7

Please sign in to comment.