Initialize a 'sigOutput' from a 'rawElementsOutput', copying or hashing the data as needed. * * '*allocation' is incremented by 'countNullDataCodes(&output->scriptPubKey)' * '*allocationLen' is decremented by 'countNullDataCodes(&output->scriptPubKey)'. * Values in the '*allocation' array may be modified. * * Precondition: NULL != result; * NULL != *allocation; *
| 246 | * countNullDataCodes(&output->scriptPubKey) <= *allocationLen |
| 247 | */ |
| 248 | static void copyOutput(sigOutput* result, opcode** allocation, size_t* allocationLen, const rawElementsOutput* output) { |
| 249 | hashBuffer(&result->scriptPubKey, &output->scriptPubKey); |
| 250 | result->emptyScript = 0 == output->scriptPubKey.len; |
| 251 | copyRawConfidential(&result->asset, output->asset); |
| 252 | copyRawAmt(&result->amt, output->value); |
| 253 | copyRawConfidential(&result->nonce, output->nonce); |
| 254 | parseNullData(&result->pnd, allocation, allocationLen, &output->scriptPubKey); |
| 255 | result->isNullData = NULL != result->pnd.op; |
| 256 | hashBuffer(&result->surjectionProofHash, is_confidential(result->asset.prefix) ? &output->surjectionProof : &(rawElementsBuffer){0}); |
| 257 | hashBuffer(&result->rangeProofHash, is_confidential(result->amt.prefix) ? &output->rangeProof : &(rawElementsBuffer){0}); |
| 258 | result->assetFee = 0; |
| 259 | } |
| 260 | |
| 261 | /* Tally a sorted list of feeOutputs |
| 262 | * |
no test coverage detected