From ebbcbf24322c0d1e5d3e386a1edb0a3b48667ae7 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Mon, 21 Mar 2016 21:08:56 +0300 Subject: [PATCH] There is no need for these conditions anymore. --- src/init.cpp | 14 ++++++-------- src/rpcwallet.cpp | 3 --- src/script.cpp | 9 +++------ src/timestamps.h | 1 - 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8fab885..994c784 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -903,14 +903,12 @@ bool AppInit2() if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), "")) strErrors << _("Cannot write default address") << "\n"; - if (fTestNet || GetTime() < SMALLDATA_SWITCH_TIME) { - CMalleableKeyView keyView = pwalletMain->GenerateNewMalleableKey(); - CMalleableKey mKey; - if (!pwalletMain->GetMalleableKey(keyView, mKey)) - strErrors << _("Unable to generate new malleable key"); - if (!pwalletMain->SetAddressBookName(CBitcoinAddress(keyView.GetMalleablePubKey()), "")) - strErrors << _("Cannot write default address") << "\n"; - } + CMalleableKeyView keyView = pwalletMain->GenerateNewMalleableKey(); + CMalleableKey mKey; + if (!pwalletMain->GetMalleableKey(keyView, mKey)) + strErrors << _("Unable to generate new malleable key"); + if (!pwalletMain->SetAddressBookName(CBitcoinAddress(keyView.GetMalleablePubKey()), "")) + strErrors << _("Cannot write default address") << "\n"; } printf("%s", strErrors.str().c_str()); diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 8c36836..5ff8320 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1898,9 +1898,6 @@ Value newmalleablekey(const Array& params, bool fHelp) "newmalleablekey\n" "Make a malleable public/private key pair.\n"); - if (!(fDebug || fTestNet) && GetTime() < SMALLDATA_SWITCH_TIME) - throw runtime_error("This feature has been disabled for mainNet clients"); - // Parse the account first so we don't generate a key if there's an error string strAccount; if (params.size() > 0) diff --git a/src/script.cpp b/src/script.cpp index 1b82de4..0f31de1 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1333,11 +1333,8 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector SMALLDATA_SWITCH_TIME) - { - // Malleable pubkey tx hack, sender provides generated pubkey combined with R parameter. The R parameter is dropped before checking a signature. - mTemplates.insert(make_pair(TX_PUBKEY_DROP, CScript() << OP_PUBKEY << OP_PUBKEY << OP_DROP << OP_CHECKSIG)); - } + // Malleable pubkey tx hack, sender provides generated pubkey combined with R parameter. The R parameter is dropped before checking a signature. + mTemplates.insert(make_pair(TX_PUBKEY_DROP, CScript() << OP_PUBKEY << OP_PUBKEY << OP_DROP << OP_CHECKSIG)); // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG)); @@ -1460,7 +1457,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector (GetTime() > SMALLDATA_SWITCH_TIME ? 1024 : 80)) + if (vch1.size() > 1024) break; } else if (opcode1 != opcode2 || vch1 != vch2) diff --git a/src/timestamps.h b/src/timestamps.h index bc4b950..57382bd 100644 --- a/src/timestamps.h +++ b/src/timestamps.h @@ -2,6 +2,5 @@ #define BITCOIN_TIMESTAMPS_H static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Saturday, 20-Jul-2013 00:00:00 UTC -static const unsigned int SMALLDATA_SWITCH_TIME = 1458432000; // Sunday, 20-Mar-16 00:00:00 UTC static const unsigned int CHECKLOCKTIMEVERIFY_SWITCH_TIME = 1461110400; // Wednesday, 20-Apr-16 00:00:00 UTC #endif -- 1.7.1