[bisq-network/bisq] Implement Segwit for BSQ (#5000)

Steven Barclay notifications at github.com
Mon Jan 18 13:18:54 CET 2021


@stejbac commented on this pull request.



> @@ -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));

Yes, perhaps that would be better. I'll push a change to do that shortly, as well as no longer excluding all but the first segwit input pubkey (to be on the safe side and consistent with the original pubkey extraction for P2PKH inputs).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5000#discussion_r559527161
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210118/2c1d89a5/attachment.htm>


More information about the bisq-github mailing list