I'm trying to do a 2 of 3 multi signature transaction. Everything works fine if I use no metadata. However when I add some metadata to the spending transaction the following happens:
1. create funding txn with metadata : OK
2. append metadata to funding txn : OK
3. sign funding txn : OK
4. send funding txn (to multisig address) : OK
5. create spending txn from funding txn output : OK
6. append metadata to spending txn : OK
7. sign spending txn with input, scriptpubkey and redeemscript : OK
8. counter-sign spending txn with input, scriptpubkey and redeemscript : OK
9. send spending transaction : ERROR: <64: Tx with metadata should have at least one SIGHASH_ALL output (code: -26)>
I guess the problem is with the signature which I do the same way as ususal:
Please note, that if I don't append metadata to the same spending transaction, everything works fine.
Can you help me with this? Thanks a lot!