Browse Source

Introduce option to disable relay/mining of bare multisig scripts in TX outputs

First and foremost, this defaults to OFF.

This option lets a node consider such transactions non-standard,
meaning they will not be relayed or mined by default, but other miners
are free to mine these as usual.
0.10
Jeff Garzik 11 years ago
parent
commit
3da434a2ef
  1. 6
      src/init.cpp
  2. 7
      src/main.cpp
  3. 1
      src/main.h

6
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 += " -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 += " -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 += " -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 += " -port=<port> " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n";
strUsage += " -proxy=<ip:port> " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -proxy=<ip:port> " + _("Connect through SOCKS5 proxy") + "\n";
strUsage += " -seednode=<ip> " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\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); bSpendZeroConfChange = GetArg("-spendzeroconfchange", true);
std::string strWalletFile = GetArg("-wallet", "wallet.dat"); 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 // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Sanity check // Sanity check
if (!InitSanityCheck()) if (!InitSanityCheck())

7
src/main.cpp

@ -48,6 +48,7 @@ bool fImporting = false;
bool fReindex = false; bool fReindex = false;
bool fBenchmark = false; bool fBenchmark = false;
bool fTxIndex = false; bool fTxIndex = false;
bool fIsBareMultisigStd = true;
unsigned int nCoinCacheSize = 5000; unsigned int nCoinCacheSize = 5000;
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ /** 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"; reason = "scriptpubkey";
return false; return false;
} }
if (whichType == TX_NULL_DATA) if (whichType == TX_NULL_DATA)
nDataOut++; nDataOut++;
else if (txout.IsDust(::minRelayTxFee)) { else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
reason = "bare-multisig";
return false;
} else if (txout.IsDust(::minRelayTxFee)) {
reason = "dust"; reason = "dust";
return false; return false;
} }

1
src/main.h

@ -94,6 +94,7 @@ extern bool fReindex;
extern bool fBenchmark; extern bool fBenchmark;
extern int nScriptCheckThreads; extern int nScriptCheckThreads;
extern bool fTxIndex; extern bool fTxIndex;
extern bool fIsBareMultisigStd;
extern unsigned int nCoinCacheSize; extern unsigned int nCoinCacheSize;
extern CFeeRate minRelayTxFee; extern CFeeRate minRelayTxFee;

Loading…
Cancel
Save