Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check current fee receiver list whenever a fee tx is validated. #6182

Merged
merged 1 commit into from May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public class MempoolService {
private final FilterManager filterManager;
private final DaoFacade daoFacade;
private final DaoStateService daoStateService;
private final List<String> btcFeeReceivers = new ArrayList<>();
@Getter
private int outstandingRequests = 0;

Expand All @@ -79,7 +78,6 @@ public MempoolService(Socks5ProxyProvider socks5ProxyProvider,
}

public void onAllServicesInitialized() {
btcFeeReceivers.addAll(getAllBtcFeeReceivers());
}

public boolean canRequestBeMade() {
Expand Down Expand Up @@ -158,7 +156,7 @@ private FutureCallback<String> callbackForMakerTxValidation(MempoolRequest theRe
public void onSuccess(@Nullable String jsonTxt) {
UserThread.execute(() -> {
outstandingRequests--;
resultHandler.accept(txValidator.parseJsonValidateMakerFeeTx(jsonTxt, btcFeeReceivers));
resultHandler.accept(txValidator.parseJsonValidateMakerFeeTx(jsonTxt, getAllBtcFeeReceivers()));
});
}

Expand Down Expand Up @@ -188,7 +186,7 @@ private FutureCallback<String> callbackForTakerTxValidation(MempoolRequest theRe
public void onSuccess(@Nullable String jsonTxt) {
UserThread.execute(() -> {
outstandingRequests--;
resultHandler.accept(txValidator.parseJsonValidateTakerFeeTx(jsonTxt, btcFeeReceivers));
resultHandler.accept(txValidator.parseJsonValidateTakerFeeTx(jsonTxt, getAllBtcFeeReceivers()));
});
}

Expand Down Expand Up @@ -252,7 +250,7 @@ private List<String> getAllBtcFeeReceivers() {
}
});
btcFeeReceivers.addAll(daoFacade.getAllDonationAddresses());
log.info("Known BTC fee receivers: {}", btcFeeReceivers.toString());
log.debug("Known BTC fee receivers: {}", btcFeeReceivers.toString());

return btcFeeReceivers;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ private boolean checkFeeAddressBTC(String jsonTxt, List<String> btcFeeReceivers)
String error = "fee address: " + jsonFeeAddress.getAsString() + " was not a known BTC fee receiver";
errorList.add(error);
log.info(error);
log.info("Known BTC fee receivers: {}", btcFeeReceivers.toString());
}
} catch (JsonSyntaxException e) {
errorList.add(e.toString());
Expand Down