Skip to content

Commit 2fff9ec

Browse files
committed
GetShieldedSpendsHash & GetShieldedOutputsHash assert txTo.sapData existence.
1 parent 3219140 commit 2fff9ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/script/interpreter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ uint256 GetOutputsHash(const CTransaction& txTo) {
11251125
}
11261126

11271127
uint256 GetShieldedSpendsHash(const CTransaction& txTo) {
1128+
assert(txTo.sapData);
11281129
CBLAKE2bWriter ss(SER_GETHASH, 0, PIVX_SHIELDED_SPENDS_HASH_PERSONALIZATION);
11291130
auto sapData = txTo.sapData;
11301131
for (const auto& n : sapData->vShieldedSpend) {
@@ -1138,6 +1139,7 @@ uint256 GetShieldedSpendsHash(const CTransaction& txTo) {
11381139
}
11391140

11401141
uint256 GetShieldedOutputsHash(const CTransaction& txTo) {
1142+
assert(txTo.sapData);
11411143
CBLAKE2bWriter ss(SER_GETHASH, 0, PIVX_SHIELDED_OUTPUTS_HASH_PERSONALIZATION);
11421144
auto sapData = txTo.sapData;
11431145
for (const auto& n : sapData->vShieldedOutput) {

0 commit comments

Comments
 (0)