Update to BitcoinJ 0.12.2

This commit is contained in:
Manfred Karrer 2014-11-17 18:57:58 +01:00
parent 29cfdd2301
commit 46a56e4e4f
4 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ repositories {
} }
dependencies { dependencies {
compile 'org.bitcoinj:bitcoinj-core:0.12' compile 'org.bitcoinj:bitcoinj-core:0.12.2'
compile 'net.tomp2p:tomp2p-all:5.0-Alpha.8f1cafb-SNAPSHOT' compile 'net.tomp2p:tomp2p-all:5.0-Alpha.8f1cafb-SNAPSHOT'
compile 'org.springframework:spring-core:4.1.1.RELEASE' compile 'org.springframework:spring-core:4.1.1.RELEASE'
compile 'net.sf.jopt-simple:jopt-simple:4.8' compile 'net.sf.jopt-simple:jopt-simple:4.8'

View file

@ -364,13 +364,11 @@ public class WalletService {
private AddressEntry getNewAddressEntry(AddressEntry.AddressContext addressContext, String offerId) { private AddressEntry getNewAddressEntry(AddressEntry.AddressContext addressContext, String offerId) {
lock.lock(); lock.lock();
wallet.getLock().lock();
DeterministicKey key = wallet.freshReceiveKey(); DeterministicKey key = wallet.freshReceiveKey();
AddressEntry addressEntry = new AddressEntry(key, params, addressContext, offerId); AddressEntry addressEntry = new AddressEntry(key, params, addressContext, offerId);
addressEntryList.add(addressEntry); addressEntryList.add(addressEntry);
saveAddressInfoList(); saveAddressInfoList();
lock.unlock(); lock.unlock();
wallet.getLock().unlock();
return addressEntry; return addressEntry;
} }

View file

@ -29,6 +29,7 @@ import org.bitcoinj.utils.Fiat;
import org.bitcoinj.utils.MonetaryFormat; import org.bitcoinj.utils.MonetaryFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -66,7 +67,8 @@ public class BSFormatter {
// Input of a group separator (1,123,45) lead to an validation error. // Input of a group separator (1,123,45) lead to an validation error.
// Note: BtcFormat was intended to be used, but it lead to many problems (automatic format to mBit, // Note: BtcFormat was intended to be used, but it lead to many problems (automatic format to mBit,
// no way to remove grouping separator). It seems to be not optimal for user input formatting. // no way to remove grouping separator). It seems to be not optimal for user input formatting.
private MonetaryFormat coinFormat = MonetaryFormat.BTC.repeatOptionalDecimals(2, 1); private MonetaryFormat coinFormat = MonetaryFormat.BTC.optionalDecimals(2)
.roundingMode(RoundingMode.HALF_UP);
private String currencyCode = Currency.getInstance(Locale.getDefault()).getCurrencyCode(); private String currencyCode = Currency.getInstance(Locale.getDefault()).getCurrencyCode();

View file

@ -85,7 +85,7 @@ public class TomP2PTests {
private static final Logger log = LoggerFactory.getLogger(TomP2PTests.class); private static final Logger log = LoggerFactory.getLogger(TomP2PTests.class);
// If you want to test in one specific connection mode define it directly, otherwise use UNKNOWN // If you want to test in one specific connection mode define it directly, otherwise use UNKNOWN
private static final ConnectionType FORCED_CONNECTION_TYPE = ConnectionType.MANUAL_PORT_FORWARDING; private static final ConnectionType FORCED_CONNECTION_TYPE = ConnectionType.DIRECT;
// Typically you run the bootstrap node in localhost to test direct connection. // Typically you run the bootstrap node in localhost to test direct connection.
// If you have a setup where you are not behind a router you can also use a WAN bootstrap node. // If you have a setup where you are not behind a router you can also use a WAN bootstrap node.