Fix UnblindConfidentialPair: use IsFullyValid() for ephemeral_key

if nNonce.vchCommitment contains invalid key of correct length,
IsValid() check will pass, but then assertion will be hit
when secp256k1_ec_pubkey_parse() is called on it inside CKey::ECDH().
Therefore, the check should be done with IsFullyValid()
This commit is contained in:
Dmitry Petukhov 2018-12-31 22:30:36 +05:00
parent 5467be3b16
commit f8a9d8bfa5
No known key found for this signature in database
GPG key ID: 2301D26BDC15160D

View file

@ -41,7 +41,7 @@ bool UnblindConfidentialPair(const CKey &key, const CConfidentialValue& confValu
return false;
}
CPubKey ephemeral_key(nNonce.vchCommitment);
if (nNonce.vchCommitment.size() > 0 && !ephemeral_key.IsValid()) {
if (nNonce.vchCommitment.size() > 0 && !ephemeral_key.IsFullyValid()) {
return false;
}