docs: public Sha256Hash getTxId() {
          if (cachedTxId == null) {
              if (!hasWitnesses() && cachedWTxId != null) {
                  cachedTxId = cachedWTxId;
              } else {
                  ByteArrayOutputStream stream = new UnsafeByteArrayOutputStream(length < 32 ? 32 : length + 32);
                  try {
                      bitcoinSerializeToStream(stream, false);
                  } catch (IOException e) {
                      throw new RuntimeException(e); // cannot happen
                  }
                  cachedTxId = Sha256Hash.wrapReversed(Sha256Hash.hashTwice(stream.toByteArray()));
              }
          }
          return cachedTxId;
      }