protected static int calcLength(byte[] buf, int offset) { VarInt varint; int cursor = offset; //vin cursor += 36; varint = new VarInt(buf, cursor); long scriptLen = varint.value; // 4 = length of sequence field (unint32) cursor += scriptLen + 4 + varint.getOriginalSizeInBytes(); //blockHash cursor += 32; //sigTime cursor += 8; //vchSig cursor = MasternodeSignature.calcLength(buf, cursor); return cursor - offset; }
protected static int calcLength(byte[] buf, int offset) { VarInt varint; int cursor = offset; //vin cursor += 36; varint = new VarInt(buf, cursor); long scriptLen = varint.value; // 4 = length of sequence field (unint32) cursor += scriptLen + 4 + varint.getOriginalSizeInBytes(); //MasternodeAddress address; cursor += MasternodeAddress.MESSAGE_SIZE; //PublicKey pubkey; cursor += PublicKey.calcLength(buf, cursor); //PublicKey pubkey2; cursor += PublicKey.calcLength(buf, cursor); // byte [] sig; cursor += MasternodeSignature.calcLength(buf, cursor); cursor += 4 + 8 + 8; cursor += MasternodeSignature.calcLength(buf, cursor); return cursor - offset; }
cursor += MasternodeSignature.calcLength(buf, cursor);