Skip to content

Commit 61244df

Browse files
datedfaustbrian
authored andcommitted
feat: support new vendorfield length (#43)
1 parent 07cf418 commit 61244df

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/org/arkecosystem/crypto/transactions/Transaction.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ private byte[] toBytes(boolean skipSignature, boolean skipSecondSignature) {
157157

158158
if (vendorField != null && !recipientId.isEmpty()) {
159159
byte[] vbytes = vendorField.getBytes();
160-
if (vbytes.length < 65) {
160+
if (vbytes.length <= 255) {
161161
buffer.put(vbytes);
162-
buffer.put(new byte[64 - vbytes.length]);
162+
if (vbytes.length < 64) {
163+
buffer.put(new byte[64 - vbytes.length]);
164+
}
163165
}
164-
165166
} else {
166167
buffer.put(new byte[64]);
167168
}

0 commit comments

Comments
 (0)