Skip to content

Commit

Permalink
[Refactoring] Don't compute depth multiple times in GetFilteredNotes
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra authored and furszy committed Apr 22, 2021
1 parent 9bec9bc commit 68b91b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sapling/saplingscriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ void SaplingScriptPubKeyMan::GetFilteredNotes(
}

// Filter the transactions before checking for notes
const int depth = wtx.GetDepthInMainChain();
if (!IsFinalTx(wtx.tx, wallet->GetLastBlockHeight() + 1, GetAdjustedTime()) ||
wtx.GetDepthInMainChain() < minDepth ||
wtx.GetDepthInMainChain() > maxDepth) {
depth < minDepth || depth > maxDepth) {
continue;
}

Expand Down Expand Up @@ -506,7 +506,7 @@ void SaplingScriptPubKeyMan::GetFilteredNotes(
// continue;
//}

saplingEntries.emplace_back(op, pa, note, notePt.memo(), wtx.GetDepthInMainChain());
saplingEntries.emplace_back(op, pa, note, notePt.memo(), depth);
}
}
}
Expand Down

0 comments on commit 68b91b1

Please sign in to comment.