From dbbdee6fd4ba81125a9454d7dbecbff5d4196368 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Thu, 19 Aug 2021 17:08:50 -0400 Subject: [PATCH] Fix build to monero master branch --- src/wire/json/write.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wire/json/write.cpp b/src/wire/json/write.cpp index 6729147..ce830ec 100644 --- a/src/wire/json/write.cpp +++ b/src/wire/json/write.cpp @@ -35,6 +35,7 @@ namespace { constexpr const unsigned flush_threshold = 100; + constexpr const unsigned max_buffer = 4096; } namespace wire @@ -44,7 +45,7 @@ namespace wire void json_writer::check_flush() { - if (needs_flush_ && (bytes_.increase_size() < flush_threshold || bytes_.increase_size() - flush_threshold < bytes_.size())) + if (needs_flush_ && (max_buffer < bytes_.size() || bytes_.available() < flush_threshold)) flush(); }