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

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3558#discussion_r342912009">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>>              return false;
-        }
 
         boolean hasSequenceNrIncreased = hasSequenceNrIncreased(protectedStorageEntry.getSequenceNumber(), hashOfPayload);
 
         // If we have seen a more recent operation for this payload, we ignore the current one
         // TODO: I think we can return false here. All callers use the get() public API which increments the sequence number
         // leaving only the onMessage() handler which doesn't look at the return value. It makes more intuitive sense that adds() that don't
</pre>
<p>Thanks again for looking through this.</p>
<p>I think my terminology may just be off here. When I refer to the "get() public API" I mean the P2PService callers that use the getProtectedStorageEntry/getRefreshTTLMessage/getMailboxDataWithSignedSeqNr APIs which grab an increasing sequence number before calling back into addProtectedStorageEntry/refreshTTL/remove/removeMailboxData.</p>
<p>Maybe I should use the term "internal callers" or "P2PService users" or "non-onMessage callers" or something else to describe the code path that follows the pattern:</p>
<pre><code>addProtectedStorageEntry(getProtectedStorageEntry());
</code></pre>
<p>What I am trying to communicate is that there are two paths through this code, the first is the onMessage handler which doesn't care about the return value so no behavior change will be noticed.</p>
<p>The second is the P2PService ("get() public API") which always uses an increasing sequence number so any failure paths that are due to sequence numbers won't trigger and the behavior will be the same as before.</p>
<p>I hope that helps communicate my intention on the deduplication of these checks.</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/3558?email_source=notifications&email_token=AJFFTNQOWKIWDDYJCMOL7HDQSJBL3A5CNFSM4JIYGGZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKNZ4GY#discussion_r342912009">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVPYU7OSPYWYFHPTMLQSJBL3ANCNFSM4JIYGGZQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNR4WMDFHF6OZ7PXO73QSJBL3A5CNFSM4JIYGGZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKNZ4GY.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/3558?email_source=notifications\u0026email_token=AJFFTNQOWKIWDDYJCMOL7HDQSJBL3A5CNFSM4JIYGGZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKNZ4GY#discussion_r342912009",
"url": "https://github.com/bisq-network/bisq/pull/3558?email_source=notifications\u0026email_token=AJFFTNQOWKIWDDYJCMOL7HDQSJBL3A5CNFSM4JIYGGZ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCKNZ4GY#discussion_r342912009",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>