rpc.getblocktemplate: set reserved_offset to zero when reserve_size==0

release-v0.6.1.2
stoffu 5 years ago
parent 5dbcceb664
commit f3425f8d32
No known key found for this signature in database
GPG Key ID: 41DAB8343A9EC012

@ -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;

Loading…
Cancel
Save