<p></p>
<p><b>@chimp1984</b> requested changes on this pull request.</p>

<p>Beside the suggestion to use a block height for activating the change all looks good to me.</p><hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5000#discussion_r554269757">core/src/main/java/bisq/core/dao/node/full/RpcService.java</a>:</p>
<pre style='color:#555'>>                      if (pubKeyAsHex == null) {
                         log.debug("pubKeyAsHex is not set as we received a not supported sigScript. " +
                                         "txId={}, asm={}, txInWitness={}",
                                 rawDtoTx.getTxId(), rawInput.getScriptSig().getAsm(), rawInput.getTxInWitness());
                     }
-                    return new TxInput(rawInput.getTxId(), rawInput.getVOut(), pubKeyAsHex);
+                    var txInput = new TxInput(rawInput.getTxId(), rawInput.getVOut(), pubKeyAsHex);
+                    txInput.isSegwit = rawInput.getTxInWitness() != null;
</pre>
<p>Wouldn't it be better to add that to the constructor so the TxInput is immutable?</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5000#discussion_r559016225">core/src/main/java/bisq/core/dao/node/full/RpcService.java</a>:</p>
<pre style='color:#555'>> @@ -246,8 +254,10 @@ private static RawTx getTxFromRawTransaction(RawTransaction rawDtoTx,
                     // To maintain backwards compatibility when serializing and hashing the DAO state,
                     // segwit pubKeys are only extracted for the first input, as this will always be a
                     // BSQ input. Later inputs might be segwit BTC, which would have had a null pubKey
-                    // recorded in the DAO state prior to the segwit upgrade of the RPC client.
-                    String pubKeyAsHex = extractPubKeyAsHex(rawInput, rawInput == rawDtoTx.getVIn().get(0));
+                    // recorded in the DAO state prior to the segwit upgrade of the RPC client. Spurious
+                    // segwit BSQ inputs in txs mined prior to the upgrade also require exclusion.
+                    String pubKeyAsHex = extractPubKeyAsHex(rawInput, rawInput == rawDtoTx.getVIn().get(0) &&
+                            !BSQ_TXS_DISALLOWING_SEGWIT_PUB_KEYS.contains(txId));
</pre>
<p>Wouldn't it be better to use a block height at which we activate the support for segwit inputs. It is technically a hard fork which would become activated at that block height.<br>
That should also cover the past tx(s) with a segwit input.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5000#pullrequestreview-564669999">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVPTSDGCYP3UFTFOFTS2HTRJANCNFSM4VIT74IQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNVCZNIANYBIA5DRI3LS2HTRJA5CNFSM4VIT74I2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEGUC4LY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5000#pullrequestreview-564669999",
"url": "https://github.com/bisq-network/bisq/pull/5000#pullrequestreview-564669999",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>