Merge #649: rawissueasset: don't make explicit 0-value which gets blinded later

d710cb588 rawissueasset: don't make explicit 0-value which gets blinded later (Gregory Sanders)

Pull request description:

  This matches the behavior of `issueasset`.

  Resolves https://github.com/ElementsProject/elements/issues/643

Tree-SHA512: 655d84a45c686f31867eccaa423279bb81481b9321eb061a85af78f12a6652899ddd1c25357e36f1257e61af6c6d9b5b007d1615c18d7a4a826844102649fe45
This commit is contained in:
Steven Roose 2019-06-05 16:15:50 +01:00
commit 335be0191b
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -2386,11 +2386,8 @@ void issueasset_base(CMutableTransaction& mtx, RawIssuanceDetails& issuance_deta
token_out.nNonce.vchCommitment = std::vector<unsigned char>(token_blind.begin(), token_blind.end());
}
// Explicit 0 is represented by a null value, don't set to non-null in that case
if (blind_issuance || token_amount != 0) {
mtx.vin[issuance_input_index].assetIssuance.nInflationKeys = token_amount;
}
// Don't make zero value output(impossible by consensus)
if (token_amount > 0) {
mtx.vin[issuance_input_index].assetIssuance.nInflationKeys = token_amount;
mtx.vout.insert(mtx.vout.begin()+token_place, token_out);
}
}