File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
src/main/java/org/twostack/bitcoin4j Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ plugins {
66}
77
88group ' org.twostack'
9- version ' 1.2.0-SNAPSHOT '
9+ version ' 1.3.0 '
1010
1111repositories {
1212 mavenCentral()
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ public byte[] sign(byte[] buffer){
4444 return sig .encodeToDER ();
4545 }
4646
47+
48+ //FIXME: We can use DumpedPrivateKey to replace the internals here
4749 public static PrivateKey fromWIF (String wif ) throws InvalidKeyException {
4850
4951 boolean isCompressed = false ;
@@ -82,6 +84,10 @@ public static PrivateKey fromWIF(String wif) throws InvalidKeyException {
8284 return new PrivateKey (key , isCompressed , networkType );
8385 }
8486
87+ public String toWif (NetworkType networkType ){
88+ return this .key .getPrivateKeyAsWiF (networkType );
89+ }
90+
8591
8692 private static NetworkType decodeNetworkType (String wifKey ) throws InvalidKeyException {
8793
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ public byte[] getTransactionIdBytes(){
259259 return new byte []{};
260260 }
261261
262- return txHash .array ();
262+ return Utils . reverseBytes ( txHash .array () );
263263 }
264264
265265 public void addOutput (TransactionOutput output ) {
You can’t perform that action at this time.
0 commit comments