<p>The order of checks was wrong.</p>
<p>PRE: it was checking the SignaturePubKey for messages that were handled by other subsystems or other trades.<br>
POST: make sure that this is a relevant message before checking that its signature matches the trade.</p>
<hr>
<h3>To reproduce the issue:</h3>
<ol>
<li>Have 3 Bisq instances: Alice, Bob, and Chris.</li>
<li>Alice creates an offer to buy.</li>
<li>Bob and Chris both consider taking the offer => Alice receives normal "OfferAvailabilityRequest" messages from them.</li>
<li>Bob takes the offer, initiating a trade with Alice.</li>
<li>Alice creates another offer.</li>
<li>Chris considers taking the offer => Alice logs 2 error messages <code>SignaturePubKey in message does not match</code>.</li>
<li>Anyone other than Bob considers taking the offer => Alice logs the same error messages.</li>
<li>Anyone other than Bob trades with Alice => Alice logs the same error messages.</li>
</ol>
<h3>Verification:</h3>
<p>After the fix, trades can be executed simultaneously between any number of peers without the error being logged.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/5196'>https://github.com/bisq-network/bisq/pull/5196</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Check isPubKeyValid only if message is one we are listening for.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5196/files#diff-c0ba8d2b73de4ca04197e2c286698d43c5c10b5fda174e02f0a3b2dadb828af8">core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java</a>
    (6)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/5196.patch'>https://github.com/bisq-network/bisq/pull/5196.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/5196.diff'>https://github.com/bisq-network/bisq/pull/5196.diff</a></li>
</ul>

<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/5196">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNRHQKWXPVRNBE6VBQDS7KQ5XANCNFSM4XWZ3B4A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNQJUSWO6VGDMCPUJRLS7KQ5XA5CNFSM4XWZ3B4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MB725LA.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/5196",
"url": "https://github.com/bisq-network/bisq/pull/5196",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>