Description:
I am trying to sign an input that was sent to a p2sh-p2wsh address, but signrawtransaction RPC method returns an error stating = Witness program was passed an empty witness. All the data can be seen through pastebin
Reproduction
Reproducible by following these actions (note that wallet does NOT know anything about address/private keys used): Related address info (2of2 P2SH-P2WSH address): https://pastebin.com/TE1LrR44
-
Raw transaction request/response: https://pastebin.com/r6HdMwsy
-
SignRaw transaction request/response:
Expected behavior
I’d expect for it to sign a transaction just as if spendable input was inside wallet. Which I tested works just fine. I imported the address using import priv key->add multisig address->addwitnessaddress then created a deposit to it and then spent it, transaction went through without a hitch.
Actual behaviour
You can see the result in step 2.2.
Additional info
I talked about it at IRC bitcoin-core-dev channel with meshcollider. He said there might be an issue where I would need to pass in witness program as well to the signrawtransaction method and that it should add witness object if it is required since createrawtransaction method can’t possibly know if output is plain p2sh or a segwit wrapper.
What version of bitcoin-core are you using?
I am running v0.15.1.0-g7b57bc998f retrieved through Ubuntu PPA.