Add listeners if pricefeed is not available

This commit is contained in:
Manfred Karrer 2016-04-16 15:46:45 +02:00
parent 3b94eda701
commit b97506cf51
11 changed files with 150 additions and 42 deletions

View file

@ -107,6 +107,7 @@ public class PriceFeed {
return null;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Setter
///////////////////////////////////////////////////////////////////////////////////////////

View file

@ -277,7 +277,8 @@ public final class Offer implements StoragePayload, RequiresOwnerIsOnlinePayload
resultHandler.handleResult();
},
(errorMessage) -> {
availabilityProtocol.cancel();
if (availabilityProtocol != null)
availabilityProtocol.cancel();
log.error(errorMessage);
});
availabilityProtocol.sendOfferAvailabilityRequest();
@ -370,8 +371,8 @@ public final class Offer implements StoragePayload, RequiresOwnerIsOnlinePayload
return null;
}
} else {
log.warn("We don't have a market price./n" +
"That case could only happen if you don't get a price feed.");
log.warn("We don't have a market price.\n" +
"That case could only happen if you don't have a price feed.");
return null;
}
} else {