<p>For better resiliance in case all seed nodes would go offline, we persist the mailbox messages and republish them at startup.<br>
We had already a persistence for own mailbox messages and reuse that but add all mailbox messages.<br>
We check for the TTL to not publish expired messages as well we check if we have received a remove message for that mailbox message.</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/5072'>https://github.com/bisq-network/bisq/pull/5072</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Refactor: Move mailbox related classed to mailbox package. Make constructor public.</li>
  <li>Make some methods default</li>
  <li>Move mailbox related code from P2PService to MailboxMessageService</li>
  <li>Remove getMailBoxMessages from P2PService and use MailboxMessageService instead</li>
  <li>Remove addDecryptedMailboxListener from P2PService and use MailboxMessageService instead</li>
  <li>Remove removePrivateNotification from P2PService and use MailboxMessageService instead</li>
  <li>Remove sendEncryptedMailboxMessage from P2PService and use MailboxMessageService instead</li>
  <li>Cleanups</li>
  <li>Fix null pointer</li>
  <li>Add new methods, make decryptedMessageWithPubKey nullable</li>
  <li>Refactor: Rename</li>
  <li>Filter expired entries at startup</li>
  <li>Refactor: Rename</li>
  <li>Remove nullable return value from decryptProtectedMailboxStorageEntry</li>
  <li>Add filter for isMine at getMyMailBoxMessages</li>
  <li>Remove old code</li>
  <li>Add onRemoved method to remove mailbox entries once a remove message arrives</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-461c200e2a3b2d93f9faa68cbf3cd69dd61073ba8e1f05c6ab626b03a68f3d7f">core/src/main/java/bisq/core/alert/PrivateNotificationManager.java</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-70051f6ac8abd4ae16ac242b7f8a6fe972ddb3c1c8be251e07aff84cae985e56">core/src/main/java/bisq/core/alert/PrivateNotificationMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-0be8e73840be9780814bc0fd933714e8fca421bd8aa2f4ecab76cf9c8da992b3">core/src/main/java/bisq/core/proto/persistable/CorePersistenceProtoResolver.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-dd70db21a8bf2b1d7035e08044edd065e44a1b1c3a8eae74f4476071fe70149e">core/src/main/java/bisq/core/setup/CorePersistedDataHost.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c844ab4120b637f296d646a14034e3a1752ee9e85fecbc080c2c38a79d1c5393">core/src/main/java/bisq/core/support/SupportManager.java</a>
    (17)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-4918defdef4db0fca38f6eaf020e25581c0d0b5d80871898ad764410cc5dcc45">core/src/main/java/bisq/core/support/dispute/DisputeManager.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-dfe9a7f8991ae28b8b7c28b75d7e4b574770f04717ca118263b878f49c02b3b8">core/src/main/java/bisq/core/support/dispute/arbitration/ArbitrationManager.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-88d80f1d29ecdb381c8c91d08d4d6818c0fdd6cdc0e6927b886868faa898f56d">core/src/main/java/bisq/core/support/messages/SupportMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-f24ccc2fb412040e1bf11ca2e4193caff23cfe990e775374c15fbc689fa040dd">core/src/main/java/bisq/core/trade/closed/CleanupMailboxMessages.java</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-d688a05c05dc6153ea3adf68e52f3c31a58562514172e25913d49d39e198375f">core/src/main/java/bisq/core/trade/messages/CounterCurrencyTransferStartedMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-f53d9b9bf699872cf63fe614b002f30f7af98df2b5be764683895b25fc51bf13">core/src/main/java/bisq/core/trade/messages/DepositTxAndDelayedPayoutTxMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-f12196ef6c6fd62020219432f7f2dcb993a77bd41f383d8bd49de21692620b83">core/src/main/java/bisq/core/trade/messages/MediatedPayoutTxPublishedMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-6097ec668529fd4b20ba3de16afc6c37191797db5e802a0c9bee0c12a5565a2d">core/src/main/java/bisq/core/trade/messages/MediatedPayoutTxSignatureMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-636af165f0e3c746cb14a9598cffe9bf1674686c590a6666d3b3fba002eefd4b">core/src/main/java/bisq/core/trade/messages/PayoutTxPublishedMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-bbe42d1b5fdba01b7514e67fe1b0bfe3222888619e4b873f29a1683dfcc1c681">core/src/main/java/bisq/core/trade/messages/PeerPublishedDelayedPayoutTxMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-0ba2ad6f79ad92af5e4167e029580e34fd52e97ce812ac197d59ecd6d5adc517">core/src/main/java/bisq/core/trade/messages/RefreshTradeStateRequest.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-909ea79598e845742cf875b788b2d3493e21d8de397b52d0ba882a3019dded2a">core/src/main/java/bisq/core/trade/messages/TraderSignedWitnessMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c0ba8d2b73de4ca04197e2c286698d43c5c10b5fda174e02f0a3b2dadb828af8">core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-35e61723916d0f20fb1dd6200c4fdab259fb5fca76341535fc7ffd3161d28588">core/src/main/java/bisq/core/trade/protocol/tasks/SendMailboxMessageTask.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-d8a12a186d80a4c21552e6cad564ca4ebc719ba95a7ef9a6cb123e47aded212f">core/src/main/java/bisq/core/trade/protocol/tasks/mediation/SendMediatedPayoutSignatureMessage.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-6e51820a7ab1b52b5bc148016e47e6d9b45183fab76ce579bf799baeb2a79d30">core/src/main/java/bisq/core/user/Cookie.java</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-423af58238b32c9b742d566eeb8dde5f910580a2063d3be4ca47f7d405e6ba3f">p2p/src/main/java/bisq/network/p2p/AckMessage.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c159620533c6a13a99158d534b441d96836d1535ce5bd6baf816b5a2fe126b25">p2p/src/main/java/bisq/network/p2p/P2PService.java</a>
    (376)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-bf8f06baf9a2a61ace0a31ab51e4602d2159719549db746f8f5766786a47009e">p2p/src/main/java/bisq/network/p2p/PrefixedSealedAndSignedMessage.java</a>
    (2)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c20785775d1f95e88f532e14940969ce53d6226c8297b679379653600b62049a">p2p/src/main/java/bisq/network/p2p/mailbox/MailboxItem.java</a>
    (52)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c9f27be6f8a644cb0165d5252a84339c660486c02332695ccbf7f9f351246f15">p2p/src/main/java/bisq/network/p2p/mailbox/MailboxMessage.java</a>
    (6)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-fce073597a840231bcce968fe684d86c9d1d321e324364ae9d6877ec79587970">p2p/src/main/java/bisq/network/p2p/mailbox/MailboxMessageList.java</a>
    (4)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-24129054dad346d9a7e3cb022f03fe4d48bc85cdbeaa2ea30b5810b5e41cba16">p2p/src/main/java/bisq/network/p2p/mailbox/MailboxMessageService.java</a>
    (589)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-766f3287f4368a8f6cc33ea528ffd1f223d59b2d6af173abc296a7c47e18eb7f">p2p/src/main/java/bisq/network/p2p/network/SetupListener.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-c2a87e7e948fe43371b977ea92f61ee4805eaf8f8742990f17932c22cd6bf313">p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataManager.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-45fc34501c30dffd0b312454da94f2dd0c9df7b8135a4a5019606372c82c3959">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5072/files#diff-71ed5b20c74f64d80b0316679a9a526bfbf9d1332c37c7a3741f0a36d4c0438b">p2p/src/test/java/bisq/network/p2p/mocks/MockMailboxPayload.java</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/5072.patch'>https://github.com/bisq-network/bisq/pull/5072.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/5072.diff'>https://github.com/bisq-network/bisq/pull/5072.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/5072">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXAC5JFPMPN6HYPGITSZJDTLANCNFSM4V43SQAA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUOMOQJSJKCSAU6Z4LSZJDTLA5CNFSM4V43SQAKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4LVK3EWQ.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/5072",
"url": "https://github.com/bisq-network/bisq/pull/5072",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>