The implementation is inconsistent, with the first half of the function serializing the data manually and the second half calling CTransactionSignatureSerializer already. Use CTSS for the first half as well.