elements/src/rpc
MarcoFalke c0b389b335
Merge #18484: rpc: Correctly compute redeemScript from witnessScript for signrawtransaction
cd3b1569d9 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 https://github.com/bitcoin/bitcoin/pull/18484/commits/cd3b1569d9ad8e24d3a222aff74e0c254baadf79

Tree-SHA512: afac671dbb52ce88bfb4a9ca3dd6065427ad52c9778d0549ad40e9286778f308adad24fb3b3c3089545d7f88c57c53d41224fd7a4bb207550eff2fe06600118f
2020-04-07 00:59:48 +08:00
..
blockchain.cpp rpc: fix broken RPCExamples for waitforblock(height) 2020-03-21 14:56:33 +01:00
blockchain.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
client.cpp [rpc] expose ability to mock scheduler via the rpc 2020-02-17 14:49:34 -08:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp util: Replace i64tostr with ToString 2020-03-27 10:14:08 -04:00
misc.cpp rpc: Document an RPCResult for all calls; Enforce at compile time 2020-03-13 15:36:15 -04:00
net.cpp Merge #18134: Replace std::to_string with locale-independent alternative 2020-03-25 20:11:47 +01:00
protocol.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
rawtransaction.cpp Replace std::to_string with locale-independent alternative 2020-03-14 12:23:01 -07:00
rawtransaction_util.cpp Correctly compute redeemScript from witnessScript for signrawtransaction 2020-03-31 18:41:52 -04:00
rawtransaction_util.h Refactor rawtransaction's SignTransaction into generic SignTransaction function 2020-03-08 12:26:27 -04:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
request.h rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
server.cpp rpc: Document an RPCResult for all calls; Enforce at compile time 2020-03-13 15:36:15 -04:00
server.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
util.cpp Bugfix: RPC: JSON null is not "None" 2020-04-02 15:28:05 +00:00
util.h rpc: Document an RPCResult for all calls; Enforce at compile time 2020-03-13 15:36:15 -04:00