File tree 3 files changed +8
-2
lines changed
src/main/java/org/twostack/bitcoin4j
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ plugins {
6
6
}
7
7
8
8
group ' org.twostack'
9
- version ' 1.2.0-SNAPSHOT '
9
+ version ' 1.3.0 '
10
10
11
11
repositories {
12
12
mavenCentral()
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ public byte[] sign(byte[] buffer){
44
44
return sig .encodeToDER ();
45
45
}
46
46
47
+
48
+ //FIXME: We can use DumpedPrivateKey to replace the internals here
47
49
public static PrivateKey fromWIF (String wif ) throws InvalidKeyException {
48
50
49
51
boolean isCompressed = false ;
@@ -82,6 +84,10 @@ public static PrivateKey fromWIF(String wif) throws InvalidKeyException {
82
84
return new PrivateKey (key , isCompressed , networkType );
83
85
}
84
86
87
+ public String toWif (NetworkType networkType ){
88
+ return this .key .getPrivateKeyAsWiF (networkType );
89
+ }
90
+
85
91
86
92
private static NetworkType decodeNetworkType (String wifKey ) throws InvalidKeyException {
87
93
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ public byte[] getTransactionIdBytes(){
259
259
return new byte []{};
260
260
}
261
261
262
- return txHash .array ();
262
+ return Utils . reverseBytes ( txHash .array () );
263
263
}
264
264
265
265
public void addOutput (TransactionOutput output ) {
You can’t perform that action at this time.
0 commit comments