mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 04:06:23 -04:00
fix concurrency issues by synchronizing on base persistable list
This commit is contained in:
parent
3c6914ac7e
commit
9027ce6634
15 changed files with 262 additions and 220 deletions
|
@ -48,12 +48,14 @@ public class MailboxMessageList extends PersistableList<MailboxItem> {
|
|||
|
||||
@Override
|
||||
public Message toProtoMessage() {
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setMailboxMessageList(protobuf.MailboxMessageList.newBuilder()
|
||||
.addAllMailboxItem(getList().stream()
|
||||
.map(MailboxItem::toProtoMessage)
|
||||
.collect(Collectors.toList())))
|
||||
.build();
|
||||
synchronized (getList()) {
|
||||
return protobuf.PersistableEnvelope.newBuilder()
|
||||
.setMailboxMessageList(protobuf.MailboxMessageList.newBuilder()
|
||||
.addAllMailboxItem(getList().stream()
|
||||
.map(MailboxItem::toProtoMessage)
|
||||
.collect(Collectors.toList())))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
public static MailboxMessageList fromProto(protobuf.MailboxMessageList proto,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue