summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevoskuil <eric@voskuil.org>2014-03-27 21:27:59 (GMT)
committer evoskuil <eric@voskuil.org>2014-03-27 21:27:59 (GMT)
commit6f143c62800dd8f6cbfa1d12ec721e2a780fbff4 (patch)
treea878be6bc197fdb5f220a3c5379584c69eb7f190
parent234d24ad92ecc4f722f50ed735eb4cf8c2d43220 (diff)
parent5caa8cbc850fec08534c681845bfe3c4672c14bc (diff)
Merge branch 'spesmilo/master', remove compile guards.refs/pull/11/head
-rw-r--r--src/worker/main.cpp2
-rw-r--r--src/worker/publisher.cpp16
-rw-r--r--src/worker/publisher.hpp4
-rw-r--r--src/worker/service/blockchain.cpp5
-rw-r--r--src/worker/service/fetch_x.cpp5
-rw-r--r--src/worker/service/fetch_x.hpp2
-rw-r--r--src/worker/service/fullnode.cpp5
-rw-r--r--src/worker/service/protocol.cpp5
8 files changed, 9 insertions, 35 deletions
diff --git a/src/worker/main.cpp b/src/worker/main.cpp
index b8ab1fd..1ea37a5 100644
--- a/src/worker/main.cpp
+++ b/src/worker/main.cpp
@@ -28,7 +28,7 @@ void interrupt_handler(int)
#ifdef _MSC_VER
// This compiles for all platforms, but there is an aspect of the linux build
-// system that expects to see 'int main(...) in the source, so need both lines.
+// system that expects to see 'int main(...)' in the source, so need both lines.
int tmain(int argc, tchar* argv[])
#else
int main(int argc, char* argv[])
diff --git a/src/worker/publisher.cpp b/src/worker/publisher.cpp
index 597f5ce..82f50f0 100644
--- a/src/worker/publisher.cpp
+++ b/src/worker/publisher.cpp
@@ -27,14 +27,8 @@ bool publisher::setup_socket(
bool publisher::start(config_type& config)
{
-#ifdef _MSC_VER
-#pragma message( "WARNING: line temporarily disabled, work in progress." )
-#pragma message( "WARNING: line temporarily disabled, work in progress." )
-#else
- // THESE LINES FAIL COMPILATION ON CTP_Nov2013
node_.subscribe_blocks(std::bind(&publisher::send_blk, this, _1, _2));
node_.subscribe_transactions(std::bind(&publisher::send_tx, this, _1));
-#endif
log_debug(LOG_PUBLISHER) << "Publishing blocks: "
<< config.block_publish;
if (!setup_socket(config.block_publish, socket_block_))
@@ -56,7 +50,7 @@ void append_hash(czmqpp::message& message, const hash_digest& hash)
message.append(data_chunk(hash.begin(), hash.end()));
}
-bool publisher::send_blk(uint32_t height, const block_type& blk)
+void publisher::send_blk(uint32_t height, const block_type& blk)
{
// Serialize the height.
data_chunk raw_height = bc::uncast_type(height);
@@ -81,12 +75,11 @@ bool publisher::send_blk(uint32_t height, const block_type& blk)
if (!message.send(socket_block_))
{
log_warning(LOG_PUBLISHER) << "Problem publishing block data.";
- return false;
+ return;
}
- return true;
}
-bool publisher::send_tx(const transaction_type& tx)
+void publisher::send_tx(const transaction_type& tx)
{
data_chunk raw_tx(bc::satoshi_raw_size(tx));
auto it = satoshi_save(tx, raw_tx.begin());
@@ -96,9 +89,8 @@ bool publisher::send_tx(const transaction_type& tx)
if (!message.send(socket_tx_))
{
log_warning(LOG_PUBLISHER) << "Problem publishing tx data.";
- return false;
+ return;
}
- return true;
}
} // namespace obelisk
diff --git a/src/worker/publisher.hpp b/src/worker/publisher.hpp
index ca18d45..fcff4f8 100644
--- a/src/worker/publisher.hpp
+++ b/src/worker/publisher.hpp
@@ -20,8 +20,8 @@ private:
bool setup_socket(
const std::string& connection, czmqpp::socket& socket);
- bool send_blk(uint32_t height, const bc::block_type& blk);
- bool send_tx(const bc::transaction_type& tx);
+ void send_blk(uint32_t height, const bc::block_type& blk);
+ void send_tx(const bc::transaction_type& tx);
node_impl& node_;
czmqpp::context context_;
diff --git a/src/worker/service/blockchain.cpp b/src/worker/service/blockchain.cpp
index 15ed77f..597d97c 100644
--- a/src/worker/service/blockchain.cpp
+++ b/src/worker/service/blockchain.cpp
@@ -25,14 +25,9 @@ void blockchain_fetch_history(node_impl& node,
return;
log_debug(LOG_REQUEST) << "blockchain.fetch_history("
<< payaddr.encoded() << ", from_height=" << from_height << ")";
-#ifdef _MSC_VER
-#pragma message( "WARNING: line temporarily disabled, work in progress." )
-#else
- // THIS LINE FAILS COMPILATION ON CTP_Nov2013
node.blockchain().fetch_history(payaddr,
std::bind(send_history_result,
_1, _2, request, queue_send), from_height);
-#endif
}
void blockchain_fetch_transaction(node_impl& node,
diff --git a/src/worker/service/fetch_x.cpp b/src/worker/service/fetch_x.cpp
index 90e8eed..608e0a0 100644
--- a/src/worker/service/fetch_x.cpp
+++ b/src/worker/service/fetch_x.cpp
@@ -28,7 +28,7 @@ bool unwrap_fetch_history_args(
payaddr.set(version_byte, hash);
return true;
}
-bool send_history_result(const std::error_code& ec,
+void send_history_result(const std::error_code& ec,
const blockchain::history_list& history,
const incoming_message& request, queue_send_callback queue_send)
{
@@ -52,9 +52,6 @@ bool send_history_result(const std::error_code& ec,
// << "*.fetch_history() finished. Sending response.";
outgoing_message response(request, result);
queue_send(response);
-
- // Must return a value - what should it be?
- return false;
}
// fetch_transaction stuff
diff --git a/src/worker/service/fetch_x.hpp b/src/worker/service/fetch_x.hpp
index bd7ed34..d837c40 100644
--- a/src/worker/service/fetch_x.hpp
+++ b/src/worker/service/fetch_x.hpp
@@ -13,7 +13,7 @@ bool unwrap_fetch_history_args(
bc::payment_address& payaddr, uint32_t& from_height,
const incoming_message& request);
-bool send_history_result(const std::error_code& ec,
+void send_history_result(const std::error_code& ec,
const bc::blockchain::history_list& history,
const incoming_message& request, queue_send_callback queue_send);
diff --git a/src/worker/service/fullnode.cpp b/src/worker/service/fullnode.cpp
index 556ebeb..95d2f45 100644
--- a/src/worker/service/fullnode.cpp
+++ b/src/worker/service/fullnode.cpp
@@ -20,15 +20,10 @@ void fullnode_fetch_history(node_impl& node,
// TODO: Slows down queries!
//log_debug(LOG_WORKER) << "fetch_history("
// << payaddr.encoded() << ", from_height=" << from_height << ")";
-#ifdef _MSC_VER
-#pragma message( "WARNING: line temporarily disabled, work in progress." )
-#else
- // THIS LINE FAILS COMPILATION ON CTP_Nov2013
fetch_history(node.blockchain(), node.transaction_indexer(),
payaddr,
std::bind(send_history_result, _1, _2, request, queue_send),
from_height);
-#endif
}
} // namespace obelisk
diff --git a/src/worker/service/protocol.cpp b/src/worker/service/protocol.cpp
index 7398c3a..62ebf93 100644
--- a/src/worker/service/protocol.cpp
+++ b/src/worker/service/protocol.cpp
@@ -29,13 +29,8 @@ void protocol_broadcast_transaction(node_impl& node,
return;
}
auto ignore_send = [](const std::error_code&, size_t) {};
-#ifdef _MSC_VER
-#pragma message( "WARNING: line temporarily disabled, work in progress." )
-#else
- // THIS LINE CONSISTENTLY CAUSES A FAILURE IN CTP_Nov2013 COMPILER (CL.EXE)
// Send and hope for the best!
node.protocol().broadcast(tx, ignore_send);
-#endif
// Response back to user saying everything is fine.
write_error_code(serial, std::error_code());
log_debug(LOG_WORKER)