The calcVarInt method was using the BigEndian encoding, but according to the Bitcoin specification it should be LittleEndian.
This method was used in the serialization of the TransactionOutputs, generating invalid transactions. This PR deletes the calcVarInt method and replace it with varintBufNum, which does the same function but with LittleEndian encoding instead.
The invalid transactions were probably invisible because none of them had an output with a script length big enough to use more than 1 byte in the Varint decoding.
The
calcVarInt
method was using the BigEndian encoding, but according to the Bitcoin specification it should be LittleEndian.This method was used in the serialization of the
TransactionOutput
s, generating invalid transactions. This PR deletes thecalcVarInt
method and replace it withvarintBufNum
, which does the same function but with LittleEndian encoding instead.The invalid transactions were probably invisible because none of them had an output with a script length big enough to use more than 1 byte in the Varint decoding.