Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
WalletAppKit: remove internal use of NetworkParameters, deprecate par…
…ams()
  • Loading branch information
msgilligan committed Aug 29, 2026
commit d80c59c0d03ecb391d0be0abb76e52c366f042f9
12 changes: 7 additions & 5 deletions core/src/main/java/org/bitcoinj/kits/WalletAppKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public class WalletAppKit extends AbstractIdleService implements Closeable {
protected static final Logger log = LoggerFactory.getLogger(WalletAppKit.class);

protected final BitcoinNetwork network;
protected final NetworkParameters params;
protected final ScriptType preferredOutputScriptType;
protected final KeyChainGroupStructure structure;
protected final String filePrefix;
Expand Down Expand Up @@ -125,7 +124,6 @@ public class WalletAppKit extends AbstractIdleService implements Closeable {
public WalletAppKit(BitcoinNetwork network, ScriptType preferredOutputScriptType,
KeyChainGroupStructure structure, File directory, String filePrefix) {
this.network = Objects.requireNonNull(network);
this.params = NetworkParameters.of(this.network);
this.preferredOutputScriptType = Objects.requireNonNull(preferredOutputScriptType);
this.structure = Objects.requireNonNull(structure);
this.directory = Objects.requireNonNull(directory);
Expand Down Expand Up @@ -386,7 +384,7 @@ protected void startUp() throws Exception {
vStore = new SPVBlockStore(network, chainFile);
if (!chainFileExists || restoreFromSeed != null || restoreFromKey != null) {
if (checkpoints == null && !PlatformUtils.isAndroidRuntime()) {
checkpoints = CheckpointManager.openStream(params);
checkpoints = CheckpointManager.openStream(network);
}

if (checkpoints != null) {
Expand Down Expand Up @@ -430,7 +428,7 @@ protected void startUp() throws Exception {
for (PeerAddress addr : peerAddresses) vPeerGroup.addAddress(addr);
vPeerGroup.setMaxConnections(peerAddresses.length);
peerAddresses = null;
} else if (params.network() != BitcoinNetwork.REGTEST) {
} else if (network != BitcoinNetwork.REGTEST) {
vPeerGroup.addPeerDiscovery(discovery != null ? discovery : new DnsDiscovery(network));
}
vChain.addWallet(vWallet);
Expand Down Expand Up @@ -576,8 +574,12 @@ public BitcoinNetwork network() {
return network;
}

/**
* @deprecated Use {@link WalletAppKit#network()}
*/
@Deprecated
public NetworkParameters params() {
return params;
return NetworkParameters.of(network);
}

public BlockChain chain() {
Expand Down
Loading