mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Rename toProtoMessageSynchronized to toPersistableMessage
Make PersistableEnvelope method name less confusing, as it is only synchronised in ThreadedPersistableEnvelope.
This commit is contained in:
parent
6487f92d84
commit
9e9fc6ab57
@ -31,7 +31,7 @@ import java.util.concurrent.FutureTask;
|
||||
*/
|
||||
public interface PersistableEnvelope extends Envelope {
|
||||
|
||||
default Message toProtoMessageSynchronized() {
|
||||
default Message toPersistableMessage() {
|
||||
FutureTask<Message> toProtoOnUserThread = new FutureTask<>(this::toProtoMessage);
|
||||
UserThread.execute(toProtoOnUserThread);
|
||||
//noinspection UnstableApiUsage
|
||||
|
@ -30,7 +30,7 @@ import com.google.protobuf.Message;
|
||||
public interface ThreadedPersistableEnvelope extends PersistableEnvelope {
|
||||
|
||||
@Override
|
||||
default Message toProtoMessageSynchronized() {
|
||||
default Message toPersistableMessage() {
|
||||
synchronized (this) {
|
||||
return toProtoMessage();
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ public class FileManager<T extends PersistableEnvelope> {
|
||||
log.debug("Write to disc: {}", storageFile.getName());
|
||||
protobuf.PersistableEnvelope protoPersistable;
|
||||
try {
|
||||
protoPersistable = (protobuf.PersistableEnvelope) persistable.toProtoMessageSynchronized();
|
||||
protoPersistable = (protobuf.PersistableEnvelope) persistable.toPersistableMessage();
|
||||
if (protoPersistable.toByteArray().length == 0)
|
||||
log.error("protoPersistable is empty. persistable=" + persistable.getClass().getSimpleName());
|
||||
} catch (Throwable e) {
|
||||
|
Loading…
Reference in New Issue
Block a user