Skip to content

Commit

Permalink
BUG: Guard access to tx.sapData in connectBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Dec 15, 2020
1 parent 99a4379 commit f62ac6c
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 f62ac6c

Please sign in to comment.