@ -25,12 +25,16 @@ import java.util.stream.Collectors;
public class Bwt {
public class Bwt {
private static final Logger log = LoggerFactory . getLogger ( Bwt . class ) ;
private static final Logger log = LoggerFactory . getLogger ( Bwt . class ) ;
public static final String DEFAULT_CORE_WALLET = "sparrow" ;
private static final int IMPORT_BATCH_SIZE = 350 ;
private static final int IMPORT_BATCH_SIZE = 350 ;
private static boolean initialized ;
private Long shutdownPtr ;
private Long shutdownPtr ;
private boolean terminating ;
private boolean terminating ;
private boolean ready ;
private boolean ready ;
static {
public synchronized static void initialize ( ) {
if ( ! initialized ) {
try {
try {
org . controlsfx . tools . Platform platform = org . controlsfx . tools . Platform . getCurrent ( ) ;
org . controlsfx . tools . Platform platform = org . controlsfx . tools . Platform . getCurrent ( ) ;
if ( platform = = org . controlsfx . tools . Platform . OSX ) {
if ( platform = = org . controlsfx . tools . Platform . OSX ) {
@ -40,10 +44,12 @@ public class Bwt {
} else {
} else {
NativeUtils . loadLibraryFromJar ( "/native/linux/x64/libbwt_jni.so" ) ;
NativeUtils . loadLibraryFromJar ( "/native/linux/x64/libbwt_jni.so" ) ;
}
}
initialized = true ;
} catch ( IOException e ) {
} catch ( IOException e ) {
log . error ( "Error loading bwt library" , e ) ;
log . error ( "Error loading bwt library" , e ) ;
}
}
}
}
}
private void start ( CallbackNotifier callback ) {
private void start ( CallbackNotifier callback ) {
start ( Collections . emptyList ( ) , null , null , null , callback ) ;
start ( Collections . emptyList ( ) , null , null , null , callback ) ;
@ -111,9 +117,10 @@ public class Bwt {
} else {
} else {
bwtConfig . bitcoindAuth = config . getCoreAuth ( ) ;
bwtConfig . bitcoindAuth = config . getCoreAuth ( ) ;
}
}
if ( config . getCoreWallet ( ) ! = null & & ! config . getCoreWallet ( ) . isEmpty ( ) ) {
if ( config . getCoreMulti Wallet ( ) ! = Boolean . FALSE ) {
bwtConfig . bitcoindWallet = config . getCoreWallet ( ) ;
bwtConfig . bitcoindWallet = config . getCoreWallet ( ) ;
}
}
bwtConfig . createWalletIfMissing = true ;
Gson gson = new Gson ( ) ;
Gson gson = new Gson ( ) ;
String jsonConfig = gson . toJson ( bwtConfig ) ;
String jsonConfig = gson . toJson ( bwtConfig ) ;
@ -178,6 +185,9 @@ public class Bwt {
@SerializedName ( "bitcoind_wallet" )
@SerializedName ( "bitcoind_wallet" )
public String bitcoindWallet ;
public String bitcoindWallet ;
@SerializedName ( "create_wallet_if_missing" )
public Boolean createWalletIfMissing ;
@SerializedName ( "descriptors" )
@SerializedName ( "descriptors" )
public List < String > descriptors ;
public List < String > descriptors ;