Change the insight serverUrl, to make it not a constant but selected by the app

master
hvarona 2018-09-06 21:44:07 -04:00
parent e6350396be
commit baeaa2d8d0
2 changed files with 8 additions and 2 deletions

View File

@ -31,6 +31,8 @@ public class BroadcastTransaction extends Thread implements Callback<Txi> {
*/
private GeneralCoinAccount mAccount;
private String serverUrl;
/**
* Basic Consturctor
* @param RawTx The RawTX in Hex String
@ -38,6 +40,7 @@ public class BroadcastTransaction extends Thread implements Callback<Txi> {
* @param context This app context
*/
public BroadcastTransaction(String RawTx, GeneralCoinAccount account, String serverUrl, Context context){
this.serverUrl = serverUrl;
this.mServiceGenerator = new InsightApiServiceGenerator(serverUrl);
this.mContext = context;
this.mRawTx = RawTx;
@ -53,7 +56,7 @@ public class BroadcastTransaction extends Thread implements Callback<Txi> {
if (response.isSuccessful()) {
//TODO invalidated send
//TODO call getTransactionData
GetTransactionData trData = new GetTransactionData(response.body().txid,this.mAccount,this.mContext);
GetTransactionData trData = new GetTransactionData(response.body().txid,this.mAccount, this.serverUrl, this.mContext);
trData.start();
} else {
System.out.println("SENDTEST: not succesful " + response.message());

View File

@ -42,6 +42,8 @@ public class GetTransactionByAddress extends Thread implements Callback<AddressT
*/
private Context mContext;
private String serverUrl;
/**
* Basic consturcotr
@ -49,6 +51,7 @@ public class GetTransactionByAddress extends Thread implements Callback<AddressT
* @param context This app context
*/
public GetTransactionByAddress(GeneralCoinAccount account, String serverUrl, Context context) {
this.serverUrl = serverUrl;
this.mAccount = account;
this.mServiceGenerator = new InsightApiServiceGenerator(serverUrl);
this.mContext = context;
@ -162,7 +165,7 @@ public class GetTransactionByAddress extends Thread implements Callback<AddressT
}*/
if (tempAccount != null && transaction.getConfirm() < this.mAccount.getCryptoNet().getConfirmationsNeeded()) {
new GetTransactionData(transaction.getTxid(), tempAccount, this.mContext, true).start();
new GetTransactionData(transaction.getTxid(), tempAccount, this.serverUrl, this.mContext, true).start();
}
for (GeneralCoinAddress address : this.mAddresses) {
if (address.updateTransaction(transaction)) {