Switch on leadbyte instead of tx height when decrypting outputs

This commit is contained in:
therealyingtong 2020-08-06 12:57:48 +08:00
parent c3d89644e2
commit 878646855c
No known key found for this signature in database
GPG Key ID: 179F32A1503D607E
1 changed files with 6 additions and 6 deletions

View File

@ -362,11 +362,11 @@ fn parse_note_plaintext_without_memo<P: consensus::Parameters>(
let mut r = [0u8; 32];
r.copy_from_slice(&plaintext[20..COMPACT_NOTE_SIZE]);
let rseed = if P::is_nu_active(NetworkUpgrade::Canopy, height) {
Rseed::AfterZip212(r)
} else {
let rseed = if plaintext[0] == 0x01 {
let rcm = Fs::from_repr(FsRepr(r.try_into().expect("slice is the correct length")))?;
Rseed::BeforeZip212(rcm)
} else {
Rseed::AfterZip212(r)
};
let diversifier = Diversifier(d);
@ -553,11 +553,11 @@ pub fn try_sapling_output_recovery<P: consensus::Parameters>(
let mut r = [0u8; 32];
r.copy_from_slice(&plaintext[20..COMPACT_NOTE_SIZE]);
let rseed = if P::is_nu_active(NetworkUpgrade::Canopy, height) {
Rseed::AfterZip212(r)
} else {
let rseed = if plaintext[0] == 0x01 {
let rcm = Fs::from_repr(FsRepr(r.try_into().expect("slice is the correct length")))?;
Rseed::BeforeZip212(rcm)
} else {
Rseed::AfterZip212(r)
};
let mut memo = [0u8; 512];