witness_count_bytes is incorrect when the witness stack has more than 127 elements. It should be computed as encode_varint as is done in lines 1050 and 1051 with txin_count_bytes and txout_count_bytes.
I found the error in local using bitcoin core regtest. With this fix my transaction went through.
witness_count_bytes is incorrect when the witness stack has more than 127 elements. It should be computed as encode_varint as is done in lines 1050 and 1051 with txin_count_bytes and txout_count_bytes. I found the error in local using bitcoin core regtest. With this fix my transaction went through.