From 87c2bf94eb9e682d1bde56ed510fe968cd538ad1 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 24 Mar 2014 02:35:59 +0000 Subject: [PATCH] Disable -permitbaremultisig by default, and include a check in IsBlacklisted --- src/init.cpp | 4 ++-- src/main.cpp | 2 +- src/script.cpp | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index a6776d2db0c71..d3d777a44e1cf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -262,7 +262,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -checkblocks= " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n"; strUsage += " -checklevel= " + _("How thorough the block verification is (0-4, default: 3)") + "\n"; strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; - strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n"; + strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 0)") + "\n"; strUsage += " -loadblock= " + _("Imports blocks from external blk000??.dat file") + "\n"; strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n"; strUsage += " -par= " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n"; @@ -553,7 +553,7 @@ bool AppInit2(boost::thread_group& threadGroup) InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); } bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); - fIsBareMultisigStd = GetArg("-permitbaremultisig", true); + fIsBareMultisigStd = GetArg("-permitbaremultisig", false); strWalletFile = GetArg("-wallet", "wallet.dat"); #endif diff --git a/src/main.cpp b/src/main.cpp index 54d7f078e532d..259c4ee6f5f9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,7 +48,7 @@ bool fImporting = false; bool fReindex = false; bool fBenchmark = false; bool fTxIndex = false; -bool fIsBareMultisigStd = true; +bool fIsBareMultisigStd = false; unsigned int nCoinCacheSize = 5000; /** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */ diff --git a/src/script.cpp b/src/script.cpp index 5650dd7e1c846..c89fca55bdfd7 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1872,6 +1872,8 @@ static struct BlacklistEntry BlacklistedPrefixes[] = { {0xc4c5d791, 0xc4c5d791, "CHBS"}, // 1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T }; +extern bool fIsBareMultisigStd; + const char *CScript::IsBlacklisted() const { if (this->size() >= 7 && this->at(0) == OP_DUP) @@ -1884,6 +1886,15 @@ const char *CScript::IsBlacklisted() const if (pfx >= BlacklistedPrefixes[i].begin && pfx <= BlacklistedPrefixes[i].end) return BlacklistedPrefixes[i].name; } + else + if (!fIsBareMultisigStd) + { + txnouttype type; + vector > vSolutions; + Solver(*this, type, vSolutions); + if (type == TX_MULTISIG) + return "bare multisig"; + } return NULL; }