bitcoin/bitcoin — pull request #1818 by gavinandresen (2012-09-10 13:54:50+00:00)
Title: Add redeemScript to raw transactions API

If signrawtransaction is signing a P2SH scriptPubKey, it needs to know the Script that hashes to the P2SH address.

That isn't a problem for transactions that are in the wallet, but if you're giving the private keys to signrawtransaction then it doesn't look in the wallet, and there needed to be some way to provide the redemption Script.

This pull request makes three functional changes:

+ Adds "redeemScript" to listunspent output, when listing a p2sh/multisig output
+ Adds "redeemScript" to signrawtransaction's second argument (list of previous transaction outputs)
+ Adds a new RPC command, "createmultisig" that is just like "addmultisigaddress" but instead of adding the multisig address/redeemScript to the wallet, returns them in a JSON object.

It also includes new unit tests for the raw transaction API argument checking code (and refactors some argument checking to remove some code duplication).