MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetBlindingData

Method SetBlindingData

src/wallet/wallet.cpp:3569–3588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3567}
3568
3569void CWalletTx::SetBlindingData(const unsigned int map_index, const CPubKey& blinding_pubkey, const CAmount value, const uint256& value_factor, const CAsset& asset, const uint256& asset_factor)
3570{
3571 if (mapValue["blindingdata"].size() < (map_index + 1) * 138) {
3572 mapValue["blindingdata"].resize((tx->vout.size() + GetNumIssuances(*tx)) * 138);
3573 }
3574
3575 unsigned char* it = (unsigned char*)(&mapValue["blindingdata"][0]) + 138 * map_index;
3576
3577 *it = 1;
3578 memcpy(&*(it + 1), &value, 8);
3579 memcpy(&*(it + 9), value_factor.begin(), 32);
3580 memcpy(&*(it + 41), asset_factor.begin(), 32);
3581 memcpy(&*(it + 73), asset.begin(), 32);
3582 if (blinding_pubkey.IsFullyValid()) {
3583 memcpy(&*(it + 105), blinding_pubkey.begin(), 33);
3584 } else {
3585 memset(&*(it + 105), 0, 33);
3586 }
3587
3588}
3589
3590void CWalletTx::GetBlindingData(const CWallet& wallet, const unsigned int map_index, const std::vector<unsigned char>& vchRangeproof, const CConfidentialValue& conf_value, const CConfidentialAsset& conf_asset, const CConfidentialNonce nonce, const CScript& scriptPubKey, CPubKey* blinding_pubkey_out, CAmount* value_out, uint256* value_factor_out, CAsset* asset_out, uint256* asset_factor_out) const
3591{

Callers 1

CommitTransactionMethod · 0.80

Calls 5

GetNumIssuancesFunction · 0.85
IsFullyValidMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected