From ebd13f8e9e631b580ef5e4ccbe6b7d16442b2d75 Mon Sep 17 00:00:00 2001 From: nicksavers Date: Sat, 11 Oct 2014 17:24:08 +0200 Subject: [PATCH] Fix bug where nonce was treated for RLP conversion as byte array when it is in fact a number --- ethereumj-core/src/main/java/org/ethereum/crypto/HashUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/crypto/HashUtil.java b/ethereumj-core/src/main/java/org/ethereum/crypto/HashUtil.java index ab14d2ca..0a66c916 100644 --- a/ethereumj-core/src/main/java/org/ethereum/crypto/HashUtil.java +++ b/ethereumj-core/src/main/java/org/ethereum/crypto/HashUtil.java @@ -60,7 +60,7 @@ public class HashUtil { public static byte[] calcNewAddr(byte[] addr, byte[] nonce) { byte[] encSender = RLP.encodeElement(addr); - byte[] encNonce = RLP.encodeElement(nonce); + byte[] encNonce = RLP.encodeBigInteger(new BigInteger(1, nonce)); byte[] newAddress = sha3omit12(RLP.encodeList(encSender, encNonce)); return newAddress;