| 3983 | } |
| 3984 | |
| 3985 | void 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 | |
| 4013 | void CWalletTx::WipeUnknownBlindingData(const CWallet& wallet) |
| 4014 | { |
no test coverage detected