This commit is contained in:
Duke Leto
2020-05-29 23:10:05 -04:00
parent ff0ce2b69a
commit 9c5a4e682e

View File

@@ -2105,27 +2105,6 @@ void CWallet::GetSproutNoteWitnesses(std::vector<JSOutPoint> notes,
std::vector<boost::optional<SproutWitness>>& witnesses,
uint256 &final_anchor)
{
LOCK(cs_wallet);
witnesses.resize(notes.size());
boost::optional<uint256> rt;
int i = 0;
for (JSOutPoint note : notes) {
if (mapWallet.count(note.hash) &&
mapWallet[note.hash].mapSproutNoteData.count(note) &&
mapWallet[note.hash].mapSproutNoteData[note].witnesses.size() > 0) {
witnesses[i] = mapWallet[note.hash].mapSproutNoteData[note].witnesses.front();
if (!rt) {
rt = witnesses[i]->root();
} else {
assert(*rt == witnesses[i]->root());
}
}
i++;
}
// All returned witnesses have the same anchor
if (rt) {
final_anchor = *rt;
}
}
void CWallet::GetSaplingNoteWitnesses(std::vector<SaplingOutPoint> notes,