diff -uNr a/paymentrequestplus.cpp b/paymentrequestplus.cpp
--- a/paymentrequestplus.cpp e0f6fbb6fa1f1b39d2e9ea0721d77dc73bd52b5cb0f96b9511a3e3ae15de033254b004f1f5e3f3c982cae219121b1d8310a145f80f1d50d3e82a2d86a2c104d5
+++ b/paymentrequestplus.cpp dccded5babff41b9374052000beed756da58364c1f2fb8ab9abdb127e85dc3055add13ebf3eb3921e45b3876ed817ad735d03dd0c9ae91655450f618fde5c85c
@@ -1,5 +1,4 @@
 // Copyright (c) 2011-2014 The Bitcoin developers
-// Copyright (c) 2017 The PIVX developers
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
@@ -24,7 +23,7 @@
 class SSLVerifyError : public std::runtime_error
 {
 public:
-    SSLVerifyError(std::string err) : std::runtime_error(err) {}
+    SSLVerifyError(std::string err) : std::runtime_error(err) { }
 };
 
 bool PaymentRequestPlus::parse(const QByteArray& data)
@@ -40,7 +39,8 @@
     }
 
     parseOK = details.ParseFromString(paymentRequest.serialized_payment_details());
-    if (!parseOK) {
+    if (!parseOK)
+    {
         qWarning() << "PaymentRequestPlus::parse : Error parsing payment details";
         paymentRequest.Clear();
         return false;
@@ -76,12 +76,15 @@
     const EVP_MD* digestAlgorithm = NULL;
     if (paymentRequest.pki_type() == "x509+sha256") {
         digestAlgorithm = EVP_sha256();
-    } else if (paymentRequest.pki_type() == "x509+sha1") {
+    }
+    else if (paymentRequest.pki_type() == "x509+sha1") {
         digestAlgorithm = EVP_sha1();
-    } else if (paymentRequest.pki_type() == "none") {
+    }
+    else if (paymentRequest.pki_type() == "none") {
         qWarning() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
         return false;
-    } else {
+    }
+    else {
         qWarning() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << QString::fromStdString(paymentRequest.pki_type());
         return false;
     }
@@ -107,8 +110,8 @@
             return false;
         }
 #endif
-        const unsigned char* data = (const unsigned char*)certChain.certificate(i).data();
-        X509* cert = d2i_X509(NULL, &data, certChain.certificate(i).size());
+        const unsigned char *data = (const unsigned char *)certChain.certificate(i).data();
+        X509 *cert = d2i_X509(NULL, &data, certChain.certificate(i).size());
         if (cert)
             certs.push_back(cert);
     }
@@ -119,24 +122,26 @@
 
     // The first cert is the signing cert, the rest are untrusted certs that chain
     // to a valid root authority. OpenSSL needs them separately.
-    STACK_OF(X509)* chain = sk_X509_new_null();
-    for (int i = certs.size() - 1; i > 0; i--) {
+    STACK_OF(X509) *chain = sk_X509_new_null();
+    for (int i = certs.size()-1; i > 0; i--) {
         sk_X509_push(chain, certs[i]);
     }
-    X509* signing_cert = certs[0];
+    X509 *signing_cert = certs[0];
 
     // Now create a "store context", which is a single use object for checking,
     // load the signing cert into it and verify.
-    X509_STORE_CTX* store_ctx = X509_STORE_CTX_new();
+    X509_STORE_CTX *store_ctx = X509_STORE_CTX_new();
     if (!store_ctx) {
         qWarning() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX";
         return false;
     }
 
-    char* website = NULL;
+    char *website = NULL;
     bool fResult = true;
-    try {
-        if (!X509_STORE_CTX_init(store_ctx, certStore, signing_cert, chain)) {
+    try
+    {
+        if (!X509_STORE_CTX_init(store_ctx, certStore, signing_cert, chain))
+        {
             int error = X509_STORE_CTX_get_error(store_ctx);
             throw SSLVerifyError(X509_verify_cert_error_string(error));
         }
@@ -147,43 +152,37 @@
             int error = X509_STORE_CTX_get_error(store_ctx);
             throw SSLVerifyError(X509_verify_cert_error_string(error));
         }
-        X509_NAME* certname = X509_get_subject_name(signing_cert);
+        X509_NAME *certname = X509_get_subject_name(signing_cert);
 
         // Valid cert; check signature:
         payments::PaymentRequest rcopy(paymentRequest); // Copy
         rcopy.set_signature(std::string(""));
-        std::string data_to_verify; // Everything but the signature
+        std::string data_to_verify;                     // Everything but the signature
         rcopy.SerializeToString(&data_to_verify);
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-        EVP_MD_CTX *ctx = EVP_MD_CTX_new();
-        if (!ctx) throw SSLVerifyError("Error allocating OpenSSL context.");
-#else
-        EVP_MD_CTX _ctx;
-        EVP_MD_CTX *ctx;
-        ctx = &_ctx;
-#endif
-        EVP_PKEY* pubkey = X509_get_pubkey(signing_cert);
-        EVP_MD_CTX_init(ctx);
-        if (!EVP_VerifyInit_ex(ctx, digestAlgorithm, NULL) ||
-            !EVP_VerifyUpdate(ctx, data_to_verify.data(), data_to_verify.size()) ||
-            !EVP_VerifyFinal(ctx, (const unsigned char*)paymentRequest.signature().data(), paymentRequest.signature().size(), pubkey)) {
+        EVP_MD_CTX ctx;
+        EVP_PKEY *pubkey = X509_get_pubkey(signing_cert);
+        EVP_MD_CTX_init(&ctx);
+        if (!EVP_VerifyInit_ex(&ctx, digestAlgorithm, NULL) ||
+            !EVP_VerifyUpdate(&ctx, data_to_verify.data(), data_to_verify.size()) ||
+            !EVP_VerifyFinal(&ctx, (const unsigned char*)paymentRequest.signature().data(), paymentRequest.signature().size(), pubkey)) {
+
             throw SSLVerifyError("Bad signature, invalid PaymentRequest.");
         }
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-        EVP_MD_CTX_free(ctx);
-#endif
 
         // OpenSSL API for getting human printable strings from certs is baroque.
         int textlen = X509_NAME_get_text_by_NID(certname, NID_commonName, NULL, 0);
         website = new char[textlen + 1];
         if (X509_NAME_get_text_by_NID(certname, NID_commonName, website, textlen + 1) == textlen && textlen > 0) {
             merchant = website;
-        } else {
+        }
+        else {
             throw SSLVerifyError("Bad certificate, missing common name.");
         }
         // TODO: detect EV certificates and set merchant = business name instead of unfriendly NID_commonName ?
-    } catch (SSLVerifyError& err) {
+    }
+    catch (SSLVerifyError& err)
+    {
         fResult = false;
         qWarning() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what();
     }
@@ -197,12 +196,13 @@
     return fResult;
 }
 
-QList<std::pair<CScript, CAmount> > PaymentRequestPlus::getPayTo() const
+QList<std::pair<CScript,CAmount> > PaymentRequestPlus::getPayTo() const
 {
-    QList<std::pair<CScript, CAmount> > result;
-    for (int i = 0; i < details.outputs_size(); i++) {
+    QList<std::pair<CScript,CAmount> > result;
+    for (int i = 0; i < details.outputs_size(); i++)
+    {
         const unsigned char* scriptStr = (const unsigned char*)details.outputs(i).script().data();
-        CScript s(scriptStr, scriptStr + details.outputs(i).script().size());
+        CScript s(scriptStr, scriptStr+details.outputs(i).script().size());
 
         result.append(make_pair(s, details.outputs(i).amount()));
     }
diff -uNr a/paymentrequestplus.h b/paymentrequestplus.h
--- a/paymentrequestplus.h e7d66b696434aa7ffeb7db14348ae56a6e03b4f6d2d3a0347eda9c79b8222cca2f77c9086248a6322dde180e1a08323fd6eb55a4bf37597a41d25927d266bb39
+++ b/paymentrequestplus.h 5a9e0e72cf2213a71f6b887eaa3a4900c00a025d7ecf1f9cb13c520d781e7a73b4ad50216445951733e09fd9990ba4bdb17a558ac012e5577ac2dc653963d80a
@@ -1,15 +1,11 @@
 // Copyright (c) 2011-2014 The Bitcoin developers
-// Copyright (c) 2017 The PIVX developers
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
 #ifndef BITCOIN_QT_PAYMENTREQUESTPLUS_H
 #define BITCOIN_QT_PAYMENTREQUESTPLUS_H
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #include "paymentrequest.pb.h"
-#pragma GCC diagnostic pop
 
 #include "base58.h"
 
@@ -25,7 +21,7 @@
 class PaymentRequestPlus
 {
 public:
-    PaymentRequestPlus() {}
+    PaymentRequestPlus() { }
 
     bool parse(const QByteArray& data);
     bool SerializeToString(std::string* output) const;
@@ -37,7 +33,7 @@
     bool getMerchant(X509_STORE* certStore, QString& merchant) const;
 
     // Returns list of outputs, amount
-    QList<std::pair<CScript, CAmount> > getPayTo() const;
+    QList<std::pair<CScript,CAmount> > getPayTo() const;
 
     const payments::PaymentDetails& getDetails() const { return details; }
 
