From d3e003f76e15e2808a30107e040d519c84393bfa Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Sun, 4 Jun 2023 10:01:42 +0200 Subject: [PATCH] fix reading of compact size int as unsigned short when parsing psbts --- src/main/java/com/sparrowwallet/drongo/psbt/PSBTEntry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTEntry.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTEntry.java index fa4326d..54be38f 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTEntry.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTEntry.java @@ -188,7 +188,7 @@ public class PSBTEntry { psbtByteBuffer.get(buf); ByteBuffer byteBuffer = ByteBuffer.wrap(buf); byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - return byteBuffer.getShort(); + return Short.toUnsignedInt(byteBuffer.getShort()); } case (byte) 0xfe: { byte[] buf = new byte[4];