Skip to content

Commit

Permalink
Disable -permitbaremultisig by default, and include a check in IsBlac…
Browse files Browse the repository at this point in the history
…klisted
  • Loading branch information
luke-jr committed Mar 24, 2014
1 parent c5127b7 commit 87c2bf9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ std::string HelpMessage(HelpMessageMode hmm)
strUsage += " -checkblocks=<n> " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n";
strUsage += " -checklevel=<n> " + _("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=<file> " + _("Imports blocks from external blk000??.dat file") + "\n";
strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n";
strUsage += " -par=<n> " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n";
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
11 changes: 11 additions & 0 deletions src/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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<vector<unsigned char> > vSolutions;
Solver(*this, type, vSolutions);
if (type == TX_MULTISIG)
return "bare multisig";
}

return NULL;
}
Expand Down

0 comments on commit 87c2bf9

Please sign in to comment.