P2SH transaction signing I'm trying to redeem a 2of2 p2sh unspent output. I have the complete multisig redeem script, a single input and a single p2pkh output.

My understanding is that I should replace the ScriptPubKey of that single input with the unhashed redeemscript, serialize the Tx with SigHashAll at the end, and sign it with each of the required public keys.

This should yield an input with a signed ScriptPub of OP_0 [Sig][Sig][RedeemScript]. However, this fails to yield a valid signature. I'm using compressed keys in the redeemscript.

Each Sig is of the form OP_PUSHDATA/Size+1[DER encode Signature]

Is there something else particular about the way the transaction needs to be serialized and signed? Should I only be using uncompressed keys?
I solved this, redeemscript wasn't prefixed with pushdata which is necessary as the whole script gets pushed.