-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from haraldh/testnet3
Add testnet3 mode
- Loading branch information
Showing
6 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.bonsai.wallet32; | ||
|
||
import android.content.Context; | ||
import android.content.pm.PackageInfo; | ||
import android.content.pm.PackageManager; | ||
|
||
import com.google.bitcoin.core.NetworkParameters; | ||
import com.google.bitcoin.params.MainNetParams; | ||
import com.google.bitcoin.params.TestNet3Params; | ||
|
||
/** | ||
* @author Harald Hoyer | ||
*/ | ||
public class Constants | ||
{ | ||
private static NetworkParameters networkParameters = null; | ||
public static String CHECKPOINTS_FILENAME = null; | ||
|
||
public static NetworkParameters getNetworkParameters(Context context) | ||
{ | ||
if (networkParameters == null) { | ||
boolean TESTNET = true; | ||
|
||
try { | ||
PackageInfo pinfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); | ||
TESTNET = pinfo.versionName.contains("-test"); | ||
} catch (PackageManager.NameNotFoundException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
networkParameters = TESTNET ? TestNet3Params.get() : MainNetParams.get(); | ||
CHECKPOINTS_FILENAME = TESTNET ? "checkpoints-testnet" : "checkpoints"; | ||
} | ||
|
||
return networkParameters; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters