aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2019-04-12 12:28:54 +0900
committerstoffu <stoffu@protonmail.ch>2019-04-12 18:55:38 +0900
commitf3425f8d326570c98c44855a58fb525db189cd28 (patch)
tree7c2025ecd52bbad9cd56810624187315cfa90f44 /src/rpc
parentMerge pull request #5364 (diff)
downloadmonero-f3425f8d326570c98c44855a58fb525db189cd28.tar.xz
rpc.getblocktemplate: set reserved_offset to zero when reserve_size==0
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 3e580a0fb..269968401 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1279,7 +1279,10 @@ namespace cryptonote
LOG_ERROR("Failed to find tx pub key in blockblob");
return false;
}
- res.reserved_offset += sizeof(tx_pub_key) + 2; //2 bytes: tag for TX_EXTRA_NONCE(1 byte), counter in TX_EXTRA_NONCE(1 byte)
+ if (req.reserve_size)
+ res.reserved_offset += sizeof(tx_pub_key) + 2; //2 bytes: tag for TX_EXTRA_NONCE(1 byte), counter in TX_EXTRA_NONCE(1 byte)
+ else
+ res.reserved_offset = 0;
if(res.reserved_offset + req.reserve_size > block_blob.size())
{
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;