Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
This moved behind the transaction private key now
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlehmann committed Aug 16, 2020
1 parent 312ae2d commit 342cc11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rpc/RpcServer.cpp
Expand Up @@ -1152,25 +1152,25 @@ std::tuple<Error, uint16_t> RpcServer::getBlockTemplate(

std::vector<uint8_t> blockBlob = CryptoNote::toBinaryArray(blockTemplate);

const auto transactionPublicKey = Utilities::getTransactionPublicKeyFromExtra(
const auto transactionPrivateKey = Utilities::getTransactionPrivateKeyFromExtra(
blockTemplate.baseTransaction.extra
);

uint64_t reservedOffset = 0;

if (reserveSize > 0)
{
/* Find where in the block blob the transaction public key is */
/* Find where in the block blob the pool nonce value is */
const auto it = std::search(
blockBlob.begin(),
blockBlob.end(),
std::begin(transactionPublicKey.data),
std::end(transactionPublicKey.data)
std::begin(transactionPrivateKey.data),
std::end(transactionPrivateKey.data)
);

/* The reserved offset is past the transactionPublicKey, then past
* the extra nonce tags */
reservedOffset = (it - blockBlob.begin()) + sizeof(transactionPublicKey) + 2;
reservedOffset = (it - blockBlob.begin()) + sizeof(transactionPrivateKey) + 2;

if (reservedOffset + reserveSize > blockBlob.size())
{
Expand Down

0 comments on commit 342cc11

Please sign in to comment.