<p></p>
<p><b>@ghubstan</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5103#discussion_r563918960">daemon/src/main/java/bisq/daemon/grpc/GrpcDisputeAgentsService.java</a>:</p>
<pre style='color:#555'>> +        Optional<ServerInterceptor> rateMeteringInterceptor = rateMeteringInterceptor();
+        return rateMeteringInterceptor.map(serverInterceptor ->
+                new ServerInterceptor[]{serverInterceptor}).orElseGet(() -> new ServerInterceptor[0]);
+    }
+
+    final Optional<ServerInterceptor> rateMeteringInterceptor() {
+        CallRateMeteringInterceptor defaultCallRateMeteringInterceptor =
+                new CallRateMeteringInterceptor(new HashMap<>() {{
+                    // You can only register mainnet dispute agents in the UI.
+                    // Do not limit devs' ability to register test agents.
+                    put("registerDisputeAgent", new GrpcCallRateMeter(1, SECONDS));
+                }});
+
+        return getCustomRateMeteringInterceptor(coreApi.getConfig().appDataDir, this.getClass())
+                .or(() -> Optional.of(defaultCallRateMeteringInterceptor));
+    }
</pre>
<p>Commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/bisq-network/bisq/commit/c99624015b1a9566d1f4e3533ae12ace570618b6/hovercard" href="https://github.com/bisq-network/bisq/commit/c99624015b1a9566d1f4e3533ae12ace570618b6"><tt>c996240</tt></a> only factors out repeated calls to 'new CallRateMeteringInterceptor'.</p>
<p>I want to leave the <code>rateMeteringInterceptor</code> methods there because I expect there will be a need for other types of interceptors in the future, and I want it to be clear that the calling <code>final ServerInterceptor[] interceptors()</code> method should get them from a <code><type>Interceptor</code> method.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5103#discussion_r563918960">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNQG3ID6RTXJEIWZRFTS3WU4XANCNFSM4WOYERBA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNSE6GJ4PF2E5A4BFBDS3WU4XA5CNFSM4WOYERBKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEJH3XRQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5103#discussion_r563918960",
"url": "https://github.com/bisq-network/bisq/pull/5103#discussion_r563918960",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>