mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
UTXOProvider: replace getParams()
with network()
Since this only affects FullPrunedBlockStore, this change doesn't need deprecation.
This commit is contained in:
parent
24e030ae74
commit
99f6860ceb
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Network;
|
||||
import org.bitcoinj.crypto.ECKey;
|
||||
import org.bitcoinj.store.FullPrunedBlockStore;
|
||||
|
||||
@ -44,8 +45,8 @@ public interface UTXOProvider {
|
||||
int getChainHeadHeight() throws UTXOProviderException;
|
||||
|
||||
/**
|
||||
* The {@link NetworkParameters} of this provider.
|
||||
* @return The network parameters.
|
||||
* The {@link Network} of this provider.
|
||||
* @return the network
|
||||
*/
|
||||
NetworkParameters getParams();
|
||||
Network network();
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.store;
|
||||
|
||||
import org.bitcoinj.base.Network;
|
||||
import org.bitcoinj.base.ScriptType;
|
||||
import org.bitcoinj.base.Address;
|
||||
import org.bitcoinj.crypto.ECKey;
|
||||
@ -415,6 +416,11 @@ public class MemoryFullPrunedBlockStore implements FullPrunedBlockStore {
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Network network() {
|
||||
return params.network();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChainHeadHeight() throws UTXOProviderException {
|
||||
try {
|
||||
|
@ -4744,7 +4744,7 @@ public class Wallet extends BaseTaggableObject
|
||||
public void setUTXOProvider(@Nullable UTXOProvider provider) {
|
||||
lock.lock();
|
||||
try {
|
||||
checkArgument(provider == null || provider.getParams().equals(params));
|
||||
checkArgument(provider == null || provider.network() == params.network());
|
||||
this.vUTXOProvider = provider;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
|
@ -18,7 +18,9 @@ package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bitcoinj.base.Address;
|
||||
import org.bitcoinj.base.BitcoinNetwork;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.base.Network;
|
||||
import org.bitcoinj.base.ScriptType;
|
||||
import org.bitcoinj.base.Sha256Hash;
|
||||
import org.bitcoinj.crypto.ECKey;
|
||||
@ -74,8 +76,8 @@ public class TransactionInputTest {
|
||||
ScriptBuilder.createOutputScript(a));
|
||||
w.setUTXOProvider(new UTXOProvider() {
|
||||
@Override
|
||||
public NetworkParameters getParams() {
|
||||
return TESTNET;
|
||||
public Network network() {
|
||||
return BitcoinNetwork.TESTNET;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user