Skip to content
Permalink
Browse files

cleanup & error output

  • Loading branch information...
RocksteadyTC committed Jul 31, 2018
1 parent 2ad6ca6 commit 5cd997cfc98e6ff3d46a0fbff75a86a4f7ca9555
Showing with 4 additions and 368 deletions.
  1. +0 −11 .appveyor.yml
  2. +0 −5 .dockerignore
  3. +0 −45 .travis.yml
  4. +0 −83 Dockerfile
  5. +0 −80 Dockerfile.dev
  6. +0 −108 Dockerfile.test
  7. +4 −4 src/Rpc/RpcServer.cpp
  8. +0 −32 testnet.yml

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -947,8 +947,8 @@ bool RpcServer::on_getblocktemplate(const COMMAND_RPC_GETBLOCKTEMPLATE::request&
blob_reserve.resize(req.reserve_size, 0);

if (!m_core.getBlockTemplate(blockTemplate, acc, blob_reserve, res.difficulty, res.height)) {
logger(ERROR) << "Failed to create block template";
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: failed to create block template" };
logger(ERROR) << "Pausing for transactions, new block is pending";
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: Pausing for transactions, new block is pending" };
}

BinaryArray block_blob = toBinaryArray(blockTemplate);
@@ -962,12 +962,12 @@ bool RpcServer::on_getblocktemplate(const COMMAND_RPC_GETBLOCKTEMPLATE::request&
res.reserved_offset = slow_memmem((void*)block_blob.data(), block_blob.size(), &tx_pub_key, sizeof(tx_pub_key));
if (!res.reserved_offset) {
logger(ERROR) << "Failed to find tx pub key in blockblob";
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: failed to create block template" };
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: Pausing for transactions, new block is pending" };
}
res.reserved_offset += sizeof(tx_pub_key) + 3; //3 bytes: tag for TX_EXTRA_TAG_PUBKEY(1 byte), tag for TX_EXTRA_NONCE(1 byte), counter in TX_EXTRA_NONCE(1 byte)
if (res.reserved_offset + req.reserve_size > block_blob.size()) {
logger(ERROR) << "Failed to calculate offset for reserved bytes";
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: failed to create block template" };
throw JsonRpc::JsonRpcError{ CORE_RPC_ERROR_CODE_INTERNAL_ERROR, "Internal error: Pausing for transactions, new block is pending" };
}
} else {
res.reserved_offset = 0;

This file was deleted.

Oops, something went wrong.

0 comments on commit 5cd997c

Please sign in to comment.
You can’t perform that action at this time.