MarcoFalke c0b389b335
Merge #18484: rpc: Correctly compute redeemScript from witnessScript for signrawtransaction
cd3b1569d9ad8e24d3a222aff74e0c254baadf79 Correctly compute redeemScript from witnessScript for signrawtransaction (Andrew Chow)

Pull request description:

  `ParsePrevouts` uses `GetScriptForWitness` on the given witnessScript to find the corresponding redeemScript. This is incorrect when the witnessScript is either a P2PK or P2PKH script as it returns the corresponding P2WPK script instead of turning the witnessScript into a P2WSH script. Instead this should make the script a `WitnessV0ScriptHash` destination and get the script for that.

  Test cases are also added. These will fail on master with a `redeemScript does not correspond to witnessScript`

  Reported on [Bitcointalk](https://bitcointalk.org/index.php?topic=5236818.0)

ACKs for top commit:
  MarcoFalke:
    weak ACK cd3b1569d9, only checked that the test fails without the code change 🚰
  instagibbs:
    utACK cd3b1569d9

Tree-SHA512: afac671dbb52ce88bfb4a9ca3dd6065427ad52c9778d0549ad40e9286778f308adad24fb3b3c3089545d7f88c57c53d41224fd7a4bb207550eff2fe06600118f
2020-04-07 00:59:48 +08:00
..
2020-03-27 15:17:35 +00:00
2020-03-18 10:34:53 -07:00
2020-02-09 07:44:29 -08:00
2020-02-10 12:00:10 -08:00
2020-02-10 12:00:10 -08:00
2020-01-31 12:36:13 +00:00
2020-01-31 12:36:13 +00:00
2019-12-23 06:12:10 +07:00
2020-01-16 18:25:11 -08:00
2020-02-28 14:56:49 -08:00
2020-03-27 08:59:06 -04:00
2020-03-15 22:43:39 +00:00
2020-02-10 12:00:10 -08:00