diff options
| author | Pieter Wuille <[email protected]> | 2012-02-25 19:02:30 +0100 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-02-25 19:05:50 +0100 |
| commit | db9f2e011732d5c04728196e29e0f0a029a8ea4d (patch) | |
| tree | aff66efbdb15e5a55c724e051b885d46d45946c4 /src/main.cpp | |
| parent | Merge pull request #894 from dooglus/nosplash (diff) | |
| download | discoin-db9f2e011732d5c04728196e29e0f0a029a8ea4d.tar.xz discoin-db9f2e011732d5c04728196e29e0f0a029a8ea4d.zip | |
Do not invoke anti-DoS system for invalid BIP16 transactions
Doing so would allow an attack on old nodes, which would relay a
standard transaction spending a BIP16 output in an invalid way,
until reaching a new node, which will disconnect their peer.
Reported by makomk on IRC.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a9311e2ce..e80ecaa0d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1138,7 +1138,14 @@ bool CTransaction::ConnectInputs(MapPrevTx inputs, { // Verify signature if (!VerifySignature(txPrev, *this, i, fStrictPayToScriptHash, 0)) + { + // only during transition phase for P2SH: do not invoke anti-DoS code for + // potentially old clients relaying bad P2SH transactions + if (fStrictPayToScriptHash && VerifySignature(txPrev, *this, i, false, 0)) + return error("ConnectInputs() : %s P2SH VerifySignature failed", GetHash().ToString().substr(0,10).c_str()); + return DoS(100,error("ConnectInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str())); + } } // Mark outpoints as spent |