I have try to build a 2 of 2 p2sh transaction from scratch using the book "programming bitcoin" by Jimmy Song, we are not directly guided to make one of those so I had to modify some of the function we had to build in the book but I guess it must be working.
And here is my code: https://pastebin.com/1mCv73i2
using the functions of the book: https://github.com/jimmysong/programmingbitcoin
My question are:
- Why did the transaction was accepted by the network despite not working as intended
- Why did my input did not go to the desired p2sh address "2N7e6ZAGXoepdVYu2Y8ho7fTf6oxE3j9UwS"
- It is on the testnet but if it was not can I retrieve my satoshis on this tx ?
edit: I found my error about my redeemscript and updated my code, but now I have a "Code: -25, Error: bad-txns-inputs-missingorspent" error when I want to broadcast it
here is my raw transaction, and I have updated the pastebin for the code: https://pastebin.com/8sQBpnVY