-
Notifications
You must be signed in to change notification settings - Fork 395
Description
This may be insignificant issue, but I am porting tx blinding code to python (for python-bitcointx to be able to blind/unblind txs, and to understand this tech better myself), so I would like to clear any confusion that I have about this code - maybe I miss something, and the code is written as it is intentionally.
At the
Line 398 in 5467be3
| bool blind_issuance = (vBlindIssuanceToken.size() > nIn && vBlindIssuanceToken[nIn].IsValid()) ? true : false; |
blind_issuance will always be True, because the same condition is checked at the start of the loop:
Line 379 in 5467be3
| (nPseudo == 1 && vBlindIssuanceToken.size() > nIn && vBlindIssuanceToken[nIn].IsValid())) { |
the condition have to be true for execution to get to the line 398.
It seems to me that calculating bool blind_issuance = is unnecessary,
CalculateReissuanceToken(asset, entropy, true) should be sufficient. Maybe with assert-check that the condition is indeed true, before the call.
Also, why is the (condition) ? true : false needed at line 398 (and also at line 268) ? && already gives boolean... Again, maybe I am just missing something, or this is just a style preference to write like this ?
I'm not trying to pick at the code style or anything, I just want to understand the code thoroughly, and try to clear my doubts.