| 4060 | } |
| 4061 | |
| 4062 | CKey CWallet::GetBlindingKey(const CScript* script) const { |
| 4063 | CKey key; |
| 4064 | |
| 4065 | if (script != NULL) { |
| 4066 | std::map<CScriptID, uint256>::const_iterator it = mapSpecificBlindingKeys.find(CScriptID(*script)); |
| 4067 | if (it != mapSpecificBlindingKeys.end()) { |
| 4068 | key.Set(it->second.begin(), it->second.end(), true); |
| 4069 | if (key.IsValid()) { |
| 4070 | return key; |
| 4071 | } |
| 4072 | } |
| 4073 | } |
| 4074 | |
| 4075 | if (script != NULL && !blinding_derivation_key.IsNull()) { |
| 4076 | unsigned char vch[32]; |
| 4077 | CHMAC_SHA256(blinding_derivation_key.begin(), blinding_derivation_key.size()).Write(&((*script)[0]), script->size()).Finalize(vch); |
| 4078 | key.Set(&vch[0], &vch[32], true); |
| 4079 | if (key.IsValid()) { |
| 4080 | return key; |
| 4081 | } |
| 4082 | } |
| 4083 | |
| 4084 | return CKey(); |
| 4085 | } |
| 4086 | |
| 4087 | CPubKey CWallet::GetBlindingPubKey(const CScript& script) const |
| 4088 | { |
no test coverage detected