Skip to content

Commit

Permalink
BUG: Guard access to tx.sapData in connectBlock
Browse files Browse the repository at this point in the history
Github-Pull: #2064
Rebased-From: f62ac6c
  • Loading branch information
random-zebra authored and Fuzzbawls committed Dec 19, 2020
1 parent c12ff2b commit 43f7ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);

// Sapling update tree
for(const OutputDescription &outputDescription : tx.sapData->vShieldedOutput) {
sapling_tree.append(outputDescription.cmu);
if (tx.IsShieldedTx() && !tx.sapData->vShieldedOutput.empty()) {
for(const OutputDescription &outputDescription : tx.sapData->vShieldedOutput) {
sapling_tree.append(outputDescription.cmu);
}
}

vPos.emplace_back(tx.GetHash(), pos);
Expand Down

0 comments on commit 43f7ca7

Please sign in to comment.