rpc: fix block template reserved offset

This commit is contained in:
Samy
2026-07-05 13:45:29 +02:00
parent a523e9da2c
commit 2d4e1547fd
3 changed files with 18 additions and 5 deletions
+2 -1
View File
@@ -40,6 +40,7 @@ using namespace epee;
#include "common/updates.h"
#include "common/download.h"
#include "common/util.h"
#include "common/varint.h"
#include "common/perf_timer.h"
#include "int-util.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
@@ -1802,7 +1803,7 @@ namespace cryptonote
LOG_ERROR("Failed to find tx pub key in blockblob");
return false;
}
reserved_offset += sizeof(tx_pub_key) + 2; //2 bytes: tag for TX_EXTRA_NONCE(1 byte), counter in TX_EXTRA_NONCE(1 byte)
reserved_offset += sizeof(tx_pub_key) + 1 + tools::get_varint_byte_size(extra_nonce.size());
if(reserved_offset + extra_nonce.size() > block_blob.size())
{
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;