Fix bug where nonce was treated for RLP conversion as byte array when it is in fact a number
This commit is contained in:
parent
02c6f9c2aa
commit
ebd13f8e9e
|
@ -60,7 +60,7 @@ public class HashUtil {
|
||||||
public static byte[] calcNewAddr(byte[] addr, byte[] nonce) {
|
public static byte[] calcNewAddr(byte[] addr, byte[] nonce) {
|
||||||
|
|
||||||
byte[] encSender = RLP.encodeElement(addr);
|
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));
|
byte[] newAddress = sha3omit12(RLP.encodeList(encSender, encNonce));
|
||||||
|
|
||||||
return newAddress;
|
return newAddress;
|
||||||
|
|
Loading…
Reference in New Issue