private void tryOffers(final OfferList offers, PeerNode pn, OFFER_STATUS status) {
while(true) {
if(pn == null) {
// Fetches valid offers, then expired ones. Expired offers don't count towards failures,
// but they're still worth trying.
BlockOffer offer = offers.getFirstOffer();
if(offer == null) {
if(logMINOR) Logger.minor(this, "No more offers");
startRequests();
return;
}
pn = offer.getPeerNode();
status = tryOffer(offer, pn, offers);
}
switch(status) {
case FATAL:
offers.deleteLastOffer();