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 (hyperledger#4489)

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
  • Loading branch information
gezero authored and fab-10 committed Oct 19, 2022
1 parent 0a04381 commit 35edb60
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 35edb60

Please sign in to comment.