diff --git a/ethereumj-core/src/main/java/org/ethereum/core/Transaction.java b/ethereumj-core/src/main/java/org/ethereum/core/Transaction.java index 150253f2..a02a6a56 100644 --- a/ethereumj-core/src/main/java/org/ethereum/core/Transaction.java +++ b/ethereumj-core/src/main/java/org/ethereum/core/Transaction.java @@ -8,6 +8,7 @@ import org.ethereum.util.RLPItem; import org.ethereum.util.RLPList; import org.ethereum.util.Utils; import org.spongycastle.util.BigIntegers; +import org.spongycastle.util.encoders.Hex; import java.util.Arrays; @@ -256,8 +257,12 @@ public class Transaction { byte[] data = RLP.encodeElement(this.data); byte[] v = RLP.encodeByte( signature.v ); - byte[] r = RLP.encodeElement(BigIntegers.asUnsignedByteArray(signature.r)); - byte[] s = RLP.encodeElement(BigIntegers.asUnsignedByteArray(signature.s)); + byte[] rBytes = BigIntegers.asUnsignedByteArray(signature.r); + System.out.println(Hex.toHexString(rBytes)); + byte[] r = RLP.encodeElement(rBytes); + byte[] sBytes = BigIntegers.asUnsignedByteArray(signature.s); + System.out.println(Hex.toHexString(sBytes)); + byte[] s = RLP.encodeElement(sBytes); if(Arrays.equals(this.receiveAddress, new byte[0])) { byte[] init = RLP.encodeElement(this.init); diff --git a/ethereumj-core/src/main/java/org/ethereum/gui/PayOutDialog.java b/ethereumj-core/src/main/java/org/ethereum/gui/PayOutDialog.java index d3728dcb..297108bb 100644 --- a/ethereumj-core/src/main/java/org/ethereum/gui/PayOutDialog.java +++ b/ethereumj-core/src/main/java/org/ethereum/gui/PayOutDialog.java @@ -5,6 +5,7 @@ import org.ethereum.core.Transaction; import org.ethereum.crypto.HashUtil; import org.ethereum.manager.MainData; import org.ethereum.net.client.ClientPeer; +import org.spongycastle.util.BigIntegers; import org.spongycastle.util.encoders.Hex; import java.awt.*; @@ -70,8 +71,8 @@ class PayOutDialog extends JDialog { byte[] gasPrice= Hex.decode("09184e72a000"); byte[] gas = Hex.decode("4255"); - Transaction tx = new Transaction(null, value.toByteArray(), - gasPrice, gas, receiveAddress.getAddress(), null); + Transaction tx = new Transaction(null, gasPrice, gas, + receiveAddress.getAddress(), BigIntegers.asUnsignedByteArray(value), null); try { tx.sign(senderPrivKey);