Skip to content

Commit

Permalink
The block variable was keeping too much memory while waiting for futu…
Browse files Browse the repository at this point in the history
…re to finish (#4489)

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
  • Loading branch information
gezero authored Oct 6, 2022
1 parent 4c3514a commit e179b86
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)

final var block =
new Block(newBlockHeader, new BlockBody(transactions, Collections.emptyList()));
final String warningMessage = "Sync to block " + block.toLogString() + " failed";

if (mergeContext.get().isSyncing() || parentHeader.isEmpty()) {
LOG.debug(
Expand All @@ -187,8 +188,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
.appendNewPayloadToSync(block)
.exceptionally(
exception -> {
LOG.warn(
"Sync to block " + block.toLogString() + " failed", exception.getMessage());
LOG.warn(warningMessage, exception.getMessage());
return null;
});
return respondWith(reqId, blockParam, null, SYNCING);
Expand Down

0 comments on commit e179b86

Please sign in to comment.