Turn off logs for BlockingClient

This commit is contained in:
Manfred Karrer 2017-06-30 13:10:53 +02:00
parent ad99e66ebe
commit 35635c7b9d
13 changed files with 26 additions and 10 deletions

View file

@ -125,6 +125,7 @@ public final class AddressEntryList implements PersistableEnvelope, PersistedDat
}
public void swapToAvailable(AddressEntry addressEntry) {
log.error("swapToAvailable, offer id={}, context={}", addressEntry.getOfferId(), addressEntry.getContext());
boolean changed2 = remove(addressEntry);
boolean changed1 = add(new AddressEntry(addressEntry.getKeyPair(), AddressEntry.Context.AVAILABLE));
if (changed1 || changed2)

View file

@ -369,6 +369,7 @@ public class BtcWalletService extends WalletService {
}
public void swapTradeEntryToAvailableEntry(String offerId, AddressEntry.Context context) {
log.error("swapTradeEntryToAvailableEntry, offerId={}, context={}", offerId, context);
Optional<AddressEntry> addressEntryOptional = getAddressEntryListAsImmutableList().stream()
.filter(e -> offerId.equals(e.getOfferId()))
.filter(e -> context == e.getContext())
@ -382,6 +383,7 @@ public class BtcWalletService extends WalletService {
}
public void resetAddressEntriesForOpenOffer(String offerId) {
log.error("resetAddressEntriesForOpenOffer");
swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.OFFER_FUNDING);
swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.RESERVED_FOR_TRADE);
}

View file

@ -29,7 +29,6 @@ import io.bisq.common.proto.network.NetworkEnvelope;
import io.bisq.common.proto.persistable.PersistedDataHost;
import io.bisq.common.proto.persistable.PersistenceProtoResolver;
import io.bisq.common.storage.Storage;
import io.bisq.core.btc.AddressEntry;
import io.bisq.core.btc.wallet.BsqWalletService;
import io.bisq.core.btc.wallet.BtcWalletService;
import io.bisq.core.btc.wallet.TradeWalletService;
@ -337,8 +336,8 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
openOffer.setState(OpenOffer.State.CANCELED);
openOffers.remove(openOffer);
closedTradableManager.add(openOffer);
btcWalletService.swapTradeEntryToAvailableEntry(offer.getId(), AddressEntry.Context.OFFER_FUNDING);
btcWalletService.swapTradeEntryToAvailableEntry(offer.getId(), AddressEntry.Context.RESERVED_FOR_TRADE);
log.error("removeOpenOffer, offerid={}", offer.getId());
btcWalletService.resetAddressEntriesForOpenOffer(offer.getId());
resultHandler.handleResult();
},
errorMessageHandler);

View file

@ -86,6 +86,7 @@ public class CreateMakerFeeTx extends Task<PlaceOfferModel> {
// tx malleability
offer.setOfferFeePaymentTxId(btcTransaction.getHashAsString());
model.setTransaction(btcTransaction);
log.error("CreateMakerFeeTx, offerid={}, OFFER_FUNDING", id);
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.OFFER_FUNDING);
complete();
@ -113,6 +114,7 @@ public class CreateMakerFeeTx extends Task<PlaceOfferModel> {
checkArgument(transaction.equals(signedTx));
offer.setOfferFeePaymentTxId(transaction.getHashAsString());
model.setTransaction(transaction);
log.error("onSuccess, offerid={}, OFFER_FUNDING", id);
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.OFFER_FUNDING);
complete();

View file

@ -82,6 +82,7 @@ public class BuyerAsTakerSignAndPublishDepositTx extends TradeTask {
Timer timeoutTimer = UserThread.runAfter(() -> {
log.warn("Broadcast not completed after 5 sec. We go on with the trade protocol.");
trade.setState(Trade.State.TAKER_PUBLISHED_DEPOSIT_TX);
log.error("timeoutTimer, offerid={}, RESERVED_FOR_TRADE", id);
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.RESERVED_FOR_TRADE);
complete();
@ -104,6 +105,7 @@ public class BuyerAsTakerSignAndPublishDepositTx extends TradeTask {
log.trace("takerSignAndPublishTx succeeded " + transaction);
trade.setDepositTx(transaction);
trade.setState(Trade.State.TAKER_PUBLISHED_DEPOSIT_TX);
log.error("onSuccess, offerid={}, RESERVED_FOR_TRADE", id);
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.RESERVED_FOR_TRADE);
complete();

View file

@ -60,6 +60,7 @@ public class MakerProcessDepositTxPublishedMessage extends TradeTask {
processModel.removeMailboxMessageAfterProcessing(trade);
trade.setState(Trade.State.MAKER_RECEIVED_DEPOSIT_TX_PUBLISHED_MSG);
log.error("MakerProcessDepositTxPublishedMessage, offerid={}, RESERVED_FOR_TRADE", trade.getId());
processModel.getBtcWalletService().swapTradeEntryToAvailableEntry(trade.getId(), AddressEntry.Context.RESERVED_FOR_TRADE);
complete();

View file

@ -87,6 +87,7 @@ public class MakerSetupDepositTxListener extends TradeTask {
}
private void swapReservedForTradeEntry() {
log.error("swapReservedForTradeEntry, offerid={}, RESERVED_FOR_TRADE", trade.getId());
processModel.getBtcWalletService().swapTradeEntryToAvailableEntry(trade.getId(), AddressEntry.Context.RESERVED_FOR_TRADE);
}

View file

@ -67,8 +67,7 @@ public class SellerAsMakerCreatesAndSignsDepositTx extends TradeTask {
+ "\n------------------------------------------------------------\n");
final Coin makerInputAmount = offer.getSellerSecurityDeposit().add(trade.getTradeAmount());
Optional<AddressEntry> addressEntryOptional = walletService.getAddressEntry(id,
AddressEntry.Context.MULTI_SIG);
Optional<AddressEntry> addressEntryOptional = walletService.getAddressEntry(id, AddressEntry.Context.MULTI_SIG);
checkArgument(addressEntryOptional.isPresent(), "addressEntryOptional must be present");
AddressEntry makerMultiSigAddressEntry = addressEntryOptional.get();
makerMultiSigAddressEntry.setCoinLockedInMultiSig(makerInputAmount);

View file

@ -81,6 +81,7 @@ public class SellerAsTakerSignAndPublishDepositTx extends TradeTask {
Timer timeoutTimer = UserThread.runAfter(() -> {
log.warn("Broadcast not completed after 5 sec. We go on with the trade protocol.");
trade.setState(Trade.State.TAKER_PUBLISHED_DEPOSIT_TX);
log.error("timeoutTimer, offerid={}, RESERVED_FOR_TRADE", trade.getId());
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.RESERVED_FOR_TRADE);
complete();
@ -103,6 +104,7 @@ public class SellerAsTakerSignAndPublishDepositTx extends TradeTask {
log.trace("takerSignAndPublishTx succeeded " + transaction);
trade.setDepositTx(transaction);
trade.setState(Trade.State.TAKER_PUBLISHED_DEPOSIT_TX);
log.error("onSuccess, offerid={}, RESERVED_FOR_TRADE", trade.getId());
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.RESERVED_FOR_TRADE);
complete();

View file

@ -1037,7 +1037,10 @@ public class MainViewModel implements ViewModel {
private void swapPendingOfferFundingEntries() {
tradeManager.getAddressEntriesForAvailableBalanceStream()
.filter(addressEntry -> addressEntry.getOfferId() != null)
.forEach(addressEntry -> btcWalletService.swapTradeEntryToAvailableEntry(addressEntry.getOfferId(), AddressEntry.Context.OFFER_FUNDING));
.forEach(addressEntry -> {
log.error("swapPendingOfferFundingEntries, offerid={}, OFFER_FUNDING", addressEntry.getOfferId());
btcWalletService.swapTradeEntryToAvailableEntry(addressEntry.getOfferId(), AddressEntry.Context.OFFER_FUNDING);
});
}
private void updateBalance() {

View file

@ -659,8 +659,8 @@ class CreateOfferDataModel extends ActivatableDataModel {
}
public void swapTradeToSavings() {
btcWalletService.swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.OFFER_FUNDING);
btcWalletService.swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.RESERVED_FOR_TRADE);
log.error("swapTradeToSavings, offerid={}", offerId);
btcWalletService.resetAddressEntriesForOpenOffer(offerId);
}
private void fillPaymentAccounts() {

View file

@ -256,6 +256,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
}
public void onClose() {
log.error("onClose");
btcWalletService.resetAddressEntriesForOpenOffer(offer.getId());
}
@ -459,8 +460,8 @@ class TakeOfferDataModel extends ActivatableDataModel {
}
public void swapTradeToSavings() {
btcWalletService.swapTradeEntryToAvailableEntry(offer.getId(), AddressEntry.Context.OFFER_FUNDING);
btcWalletService.swapTradeEntryToAvailableEntry(offer.getId(), AddressEntry.Context.RESERVED_FOR_TRADE);
log.error("swapTradeToSavings, offerid={}", offer.getId());
btcWalletService.resetAddressEntriesForOpenOffer(offer.getId());
}
/* private void setFeeFromFundingTx(Coin fee) {

View file

@ -24,6 +24,9 @@
<logger name="org.bitcoinj.core.PeerSocketHandler" level="WARN"/>
<logger name="org.bitcoinj.net.NioClientManager" level="WARN"/>
<!-- We get too many errors logged from connection issues-->
<logger name="org.bitcoinj.net.BlockingClient" level="OFF"/>
<!--
<logger name="org.bitcoinj.net.ConnectionHandler" level="WARN"/>