I have fixed my initial transactions and have been able to send coins to a p2sh address
Now I want to spend those coins but when I try to broadcast my transactions either the website (blockcypher) accept it and it is then later not accepted by miners or rejected (blockstream) with:
sendrawtransaction RPC error: {"code":-26,"message":"non-mandatory-script-verify-flag (Extra items left on stack after execution)"}
I think I have made the the correct ScriptSig for the 2 of 2 multisig (OP_0, sig1, sig2, redeemscript) so I am not sure of my error:
OP_0 3045022100e91708339615eb38326a5c513b5dcc040bf59a1b97faef2c1f59a7b16426519a02200a4ca9d8c9f05ec824c70d1564ae2952650bc0ddc8bce92f081dd7d29d33d7ea01 3045022100ca0e751242a6d33ab2e895a9b1d9e5dce18426f2d11e69009e794ebc1004ba1a0220022a95a3f335fd84b380d6482948c24817a9f021f0dea75689eccf59e1540ae901 2d5214a175b609a7c37011420585f1fcf392fdda9a025414b1e9f0fa01914ff497607f99bf90dbd8a41bd8bb52ae
And here is my full tx:
0100000001f51f20dce174d1a894151bdbdf397317b97ec342c4068a6b96d95babb34baa7400000000c200483045022100e91708339615eb38326a5c513b5dcc040bf59a1b97faef2c1f59a7b16426519a02200a4ca9d8c9f05ec824c70d1564ae2952650bc0ddc8bce92f081dd7d29d33d7ea01483045022100ca0e751242a6d33ab2e895a9b1d9e5dce18426f2d11e69009e794ebc1004ba1a0220022a95a3f335fd84b380d6482948c24817a9f021f0dea75689eccf59e1540ae9012e2d5214a175b609a7c37011420585f1fcf392fdda9a025414b1e9f0fa01914ff497607f99bf90dbd8a41bd8bb52aeffffffff01401f0000000000001976a914a175b609a7c37011420585f1fcf392fdda9a025488ac00000000
and the code I use to create it: