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

Method ComputeBlindingData

src/wallet/wallet.cpp:3985–4011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3983}
3984
3985void CWallet::ComputeBlindingData(const CConfidentialValue& conf_value, const CConfidentialAsset& conf_asset, const CConfidentialNonce& nonce, const CScript& scriptPubKey, const std::vector<unsigned char>& vchRangeproof, CAmount& value, CPubKey& blinding_pubkey, uint256& value_factor, CAsset& asset, uint256& asset_factor) const
3986{
3987 if (conf_value.IsExplicit() && conf_asset.IsExplicit()) {
3988 value = conf_value.GetAmount();
3989 asset = conf_asset.GetAsset();
3990 blinding_pubkey = CPubKey();
3991 value_factor.SetNull();
3992 asset_factor.SetNull();
3993 return;
3994 }
3995
3996 CKey blinding_key;
3997 if ((blinding_key = GetBlindingKey(&scriptPubKey)).IsValid()) {
3998 // For outputs using derived blinding.
3999 if (UnblindConfidentialPair(blinding_key, conf_value, conf_asset, nonce, scriptPubKey, vchRangeproof, value, value_factor, asset, asset_factor)) {
4000 // TODO: make sure SetBlindingData sets it as receiver's blinding pubkey
4001 blinding_pubkey = blinding_key.GetPubKey();
4002 return;
4003 }
4004 }
4005
4006 value = -1;
4007 blinding_pubkey = CPubKey();
4008 value_factor.SetNull();
4009 asset.SetNull();
4010 asset_factor.SetNull();
4011}
4012
4013void CWalletTx::WipeUnknownBlindingData(const CWallet& wallet)
4014{

Callers 1

GetBlindingDataMethod · 0.80

Calls 8

UnblindConfidentialPairFunction · 0.85
IsExplicitMethod · 0.80
GetAmountMethod · 0.80
GetAssetMethod · 0.80
CPubKeyClass · 0.50
SetNullMethod · 0.45
IsValidMethod · 0.45
GetPubKeyMethod · 0.45

Tested by

no test coverage detected