mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
rpc.getblocktemplate: set reserved_offset to zero when reserve_size==0
This commit is contained in:
parent
5dbcceb664
commit
f3425f8d32
@ -1279,7 +1279,10 @@ namespace cryptonote
|
|||||||
LOG_ERROR("Failed to find tx pub key in blockblob");
|
LOG_ERROR("Failed to find tx pub key in blockblob");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
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)
|
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())
|
if(res.reserved_offset + req.reserve_size > block_blob.size())
|
||||||
{
|
{
|
||||||
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;
|
error_resp.code = CORE_RPC_ERROR_CODE_INTERNAL_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user