Refactor:

- Rename XmrTransferProofRequester to XmrTransferProofRequest
This commit is contained in:
chimp1984 2020-08-30 19:25:02 -05:00
parent 6f56f90a66
commit 40a7320f32
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
2 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
@Slf4j
class XmrTransferProofRequester {
class XmrTransferProofRequest {
// these settings are not likely to change and therefore not put into Config
private static final long REPEAT_REQUEST_PERIOD = TimeUnit.SECONDS.toMillis(90);
private static final long MAX_REQUEST_PERIOD = TimeUnit.HOURS.toMillis(12);
@ -57,10 +57,10 @@ class XmrTransferProofRequester {
// Constructor
///////////////////////////////////////////////////////////////////////////////////////////
XmrTransferProofRequester(Socks5ProxyProvider socks5ProxyProvider,
XmrProofInfo xmrProofInfo,
Consumer<XmrAutoConfirmResult> resultHandler,
FaultHandler faultHandler) {
XmrTransferProofRequest(Socks5ProxyProvider socks5ProxyProvider,
XmrProofInfo xmrProofInfo,
Consumer<XmrAutoConfirmResult> resultHandler,
FaultHandler faultHandler) {
this.httpClient = new XmrTxProofHttpClient(socks5ProxyProvider);
this.httpClient.setBaseUrl("http://" + xmrProofInfo.getServiceAddress());
if (xmrProofInfo.getServiceAddress().matches("^192.*|^localhost.*")) {

View File

@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
class XmrTransferProofService {
private final Map<String, XmrTransferProofRequester> map = new HashMap<>();
private final Map<String, XmrTransferProofRequest> map = new HashMap<>();
private final Socks5ProxyProvider socks5ProxyProvider;
@Inject
@ -52,7 +52,7 @@ class XmrTransferProofService {
}
log.info("requesting tx proof with uid {}", uid);
XmrTransferProofRequester requester = new XmrTransferProofRequester(
XmrTransferProofRequest requester = new XmrTransferProofRequest(
socks5ProxyProvider,
xmrProofInfo,
result -> {
@ -71,7 +71,7 @@ class XmrTransferProofService {
void terminateRequest(XmrProofInfo xmrProofInfo) {
String uid = xmrProofInfo.getUID();
XmrTransferProofRequester requester = map.getOrDefault(uid, null);
XmrTransferProofRequest requester = map.getOrDefault(uid, null);
if (requester != null) {
log.info("Terminating API request for request with uid {}", uid);
requester.stop();