Skip to content

BlindTransaction() code clarity issue/question #487

@dgpv

Description

@dgpv

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

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:

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions