aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-07-18 23:23:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-18 23:29:50 +0200
commitff1fe669d41814a4e0406243d1c081725006a735 (patch)
tree7da8f1b73c21f01ecb9ada221bf1e0ba703de892 /src
parentb9345f7d1c071fbbef75d79ac6a2ca8636c599e9 (diff)
parent3da434a2ef9ac76a0ad4a33921773a9ac8f10ab7 (diff)
Merge pull request #3939
3da434a Introduce option to disable relay/mining of bare multisig scripts in TX outputs (Jeff Garzik)
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp6
-rw-r--r--src/main.cpp7
-rw-r--r--src/main.h1
3 files changed, 12 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index b80d718f01..031b9db480 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -248,6 +248,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n";
strUsage += " -onion=<ip:port> " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n";
strUsage += " -onlynet=<net> " + _("Only connect to nodes in network <net> (IPv4, IPv6 or Tor)") + "\n";
+ strUsage += " -permitbaremultisig " + _("Relay non-P2SH multisig (default: 1)") + "\n";
strUsage += " -port=<port> " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n";
strUsage += " -proxy=<ip:port> " + _("Connect through SOCKS5 proxy") + "\n";
strUsage += " -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n";
@@ -676,7 +677,10 @@ bool AppInit2(boost::thread_group& threadGroup)
bSpendZeroConfChange = GetArg("-spendzeroconfchange", true);
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
-#endif
+#endif // ENABLE_WALLET
+
+ fIsBareMultisigStd = GetArg("-permitbaremultisig", true);
+
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Sanity check
if (!InitSanityCheck())
diff --git a/src/main.cpp b/src/main.cpp
index 766f0970f0..dd9e76378e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -48,6 +48,7 @@ bool fImporting = false;
bool fReindex = false;
bool fBenchmark = false;
bool fTxIndex = false;
+bool fIsBareMultisigStd = true;
unsigned int nCoinCacheSize = 5000;
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
@@ -604,9 +605,13 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
reason = "scriptpubkey";
return false;
}
+
if (whichType == TX_NULL_DATA)
nDataOut++;
- else if (txout.IsDust(::minRelayTxFee)) {
+ else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
+ reason = "bare-multisig";
+ return false;
+ } else if (txout.IsDust(::minRelayTxFee)) {
reason = "dust";
return false;
}
diff --git a/src/main.h b/src/main.h
index a683412571..20a83db605 100644
--- a/src/main.h
+++ b/src/main.h
@@ -94,6 +94,7 @@ extern bool fReindex;
extern bool fBenchmark;
extern int nScriptCheckThreads;
extern bool fTxIndex;
+extern bool fIsBareMultisigStd;
extern unsigned int nCoinCacheSize;
extern CFeeRate minRelayTxFee;