Skip to content

Commit 746b5f8

Browse files
PastaPastaPastacodablock
authored andcommitted
Remove commented out code (#3117)
* Remove LogPrints which have been commented out. We have version control systems for a reason, if we want code to not run it should be removed. I personally see no value in keeping these around. I presume at one point they were spamming debug.log so we commented them out, but we really should have just removed them. I believe all of this is dash specific code but any conflicts this does create are so minor they are not of concern imo. Signed-off-by: Pasta <pasta@dashboost.org> * remove a couple of extra comments Signed-off-by: Pasta <pasta@dashboost.org> * remove commented out code Signed-off-by: Pasta <pasta@dashboost.org>
1 parent b2c6b48 commit 746b5f8

File tree

7 files changed

+0
-86
lines changed

7 files changed

+0
-86
lines changed

src/keepass.cpp

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ void CKeePassIntegrator::init()
117117
sUrl = SecureString("http://");
118118
sUrl += SecureString(strKeePassEntryName.c_str());
119119
sUrl += SecureString("/");
120-
//sSubmitUrl = "http://";
121-
//sSubmitUrl += SecureString(strKeePassEntryName.c_str());
122120
}
123121
}
124122

@@ -288,28 +286,6 @@ static void http_request_done(struct evhttp_request *req, void *ctx)
288286
// Send RPC message to KeePassHttp
289287
void CKeePassIntegrator::doHTTPPost(const std::string& sRequest, int& nStatusRet, std::string& strResponseRet)
290288
{
291-
// // Prepare communication
292-
// boost::asio::io_service io_service;
293-
294-
// // Get a list of endpoints corresponding to the server name.
295-
// tcp::resolver resolver(io_service);
296-
// tcp::resolver::query query(KEEPASS_HTTP_HOST, boost::lexical_cast<std::string>(nPort));
297-
// tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
298-
// tcp::resolver::iterator end;
299-
300-
// // Try each endpoint until we successfully establish a connection.
301-
// tcp::socket socket(io_service);
302-
// boost::system::error_code error = boost::asio::error::host_not_found;
303-
// while (error && endpoint_iterator != end)
304-
// {
305-
// socket.close();
306-
// socket.connect(*endpoint_iterator++, error);
307-
// }
308-
309-
// if(error)
310-
// {
311-
// throw boost::system::system_error(error);
312-
// }
313289
// Create event base
314290
struct event_base *base = event_base_new(); // TODO RAII
315291
if (!base)
@@ -321,53 +297,21 @@ void CKeePassIntegrator::doHTTPPost(const std::string& sRequest, int& nStatusRet
321297
throw std::runtime_error("create connection failed");
322298
evhttp_connection_set_timeout(evcon, KEEPASS_HTTP_CONNECT_TIMEOUT);
323299

324-
// Form the request.
325-
// std::map<std::string, std::string> mapRequestHeaders;
326-
// std::string strPost = constructHTTPPost(sRequest, mapRequestHeaders);
327-
328300
HTTPReply response;
329301
struct evhttp_request *req = evhttp_request_new(http_request_done, (void*)&response); // TODO RAII
330302
if (req == nullptr)
331303
throw std::runtime_error("create http request failed");
332304

333305
struct evkeyvalq *output_headers = evhttp_request_get_output_headers(req);
334306
assert(output_headers);
335-
// s << "POST / HTTP/1.1\r\n"
336307
evhttp_add_header(output_headers, "User-Agent", ("dash-json-rpc/" + FormatFullVersion()).c_str());
337308
evhttp_add_header(output_headers, "Host", KEEPASS_HTTP_HOST);
338309
evhttp_add_header(output_headers, "Accept", "application/json");
339310
evhttp_add_header(output_headers, "Content-Type", "application/json");
340-
// evhttp_add_header(output_headers, "Content-Length", itostr(strMsg.size()).c_str());
341311
evhttp_add_header(output_headers, "Connection", "close");
342312

343-
// Logging of actual post data disabled as to not write passphrase in debug.log. Only enable temporarily when needed
344-
//LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- send POST data: %s\n", strPost);
345313
LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- send POST data\n");
346314

347-
// boost::asio::streambuf request;
348-
// std::ostream request_stream(&request);
349-
// request_stream << strPost;
350-
351-
// // Send the request.
352-
// boost::asio::write(socket, request);
353-
354-
// LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- request written\n");
355-
356-
// // Read the response status line. The response streambuf will automatically
357-
// // grow to accommodate the entire line. The growth may be limited by passing
358-
// // a maximum size to the streambuf constructor.
359-
// boost::asio::streambuf response;
360-
// boost::asio::read_until(socket, response, "\r\n");
361-
362-
// LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- request status line read\n");
363-
364-
// // Receive HTTP reply status
365-
// int nProto = 0;
366-
// std::istream response_stream(&response);
367-
// nStatus = ReadHTTPStatus(response_stream, nProto);
368-
369-
// Attach request data
370-
// std::string sRequest = JSONRPCRequest(strMethod, params, 1);
371315
struct evbuffer * output_buffer = evhttp_request_get_output_buffer(req);
372316
assert(output_buffer);
373317
evbuffer_add(output_buffer, sRequest.data(), sRequest.size());
@@ -383,25 +327,6 @@ void CKeePassIntegrator::doHTTPPost(const std::string& sRequest, int& nStatusRet
383327
evhttp_connection_free(evcon);
384328
event_base_free(base);
385329

386-
// LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- reading response body start\n");
387-
// // Read until EOF, writing data to output as we go.
388-
// while (boost::asio::read(socket, response, boost::asio::transfer_at_least(1), error))
389-
// {
390-
// if (error != boost::asio::error::eof)
391-
// {
392-
// if (error != 0)
393-
// { // 0 is success
394-
// throw boost::system::system_error(error);
395-
// }
396-
// }
397-
// }
398-
// LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- reading response body end\n");
399-
//
400-
// // Receive HTTP reply message headers and body
401-
// std::map<std::string, std::string> mapHeaders;
402-
// ReadHTTPMessage(response_stream, mapHeaders, strResponse, nProto, std::numeric_limits<size_t>::max());
403-
// LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::doHTTPPost -- Processed body\n");
404-
405330
nStatusRet = response.nStatus;
406331
if (response.nStatus == 0)
407332
throw std::runtime_error("couldn't connect to server");
@@ -451,8 +376,6 @@ std::vector<CKeePassIntegrator::CKeePassEntry> CKeePassIntegrator::rpcGetLogins(
451376

452377
doHTTPPost(request.getJson(), nStatus, strResponse);
453378

454-
// Logging of actual response data disabled as to not write passphrase in debug.log. Only enable temporarily when needed
455-
//LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcGetLogins -- send result: status: %d response: %s\n", nStatus, strResponse);
456379
LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcGetLogins -- send result: status: %d\n", nStatus);
457380

458381
if(nStatus != 200)

src/llmq/quorums_signing.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ bool CSigningManager::AsyncSignIfMember(Consensus::LLMQType llmqType, const uint
791791
}
792792

793793
if (!quorum->IsValidMember(activeMasternodeInfo.proTxHash)) {
794-
//LogPrint(BCLog::LLMQ, "CSigningManager::%s -- we're not a valid member of quorum %s\n", __func__, quorum->quorumHash.ToString());
795794
return false;
796795
}
797796

src/masternode/masternode-payments.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ bool IsOldBudgetBlockValueValid(const CBlock& block, int nBlockHeight, CAmount b
5656
LogPrint(BCLog::GOBJECT, "%s -- WARNING: Skipping old budget block value checks, accepting block\n", __func__);
5757
return true;
5858
}
59-
// LogPrint(BCLog::GOBJECT, "%s -- Block is not in budget cycle window, checking block value against block reward\n", __func__);
6059
if(!isBlockRewardValueMet) {
6160
strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded block reward, block is not in old budget cycle window",
6261
nBlockHeight, block.vtx[0]->GetValueOut(), blockReward);

src/miner.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
224224
// Update coinbase transaction with additional info about masternode and governance payments,
225225
// get some info back to pass to getblocktemplate
226226
FillBlockPayments(coinbaseTx, nHeight, blockReward, pblocktemplate->voutMasternodePayments, pblocktemplate->voutSuperblockPayments);
227-
// LogPrintf("CreateNewBlock -- nBlockHeight %d blockReward %lld txoutMasternode %s coinbaseTx %s",
228-
// nHeight, blockReward, pblocktemplate->txoutsMasternode.ToString(), coinbaseTx.ToString());
229227

230228
pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));
231229
pblocktemplate->vTxFees[0] = -nFees;

src/privatesend/privatesend-client.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ void CPrivateSendClientManager::ProcessMessage(CNode* pfrom, const std::string&
5252
// process every dsq only once
5353
for (const auto& q : vecPrivateSendQueue) {
5454
if (q == dsq) {
55-
// LogPrint(BCLog::PRIVATESEND, "DSQUEUE -- %s seen\n", dsq.ToString());
5655
return;
5756
}
5857
}
@@ -143,7 +142,6 @@ void CPrivateSendClientSession::ProcessMessage(CNode* pfrom, const std::string&
143142

144143
if (!mixingMasternode) return;
145144
if (mixingMasternode->pdmnState->addr != pfrom->addr) {
146-
//LogPrint(BCLog::PRIVATESEND, "DSSTATUSUPDATE -- message doesn't match current Masternode: infoMixingMasternode %s addr %s\n", infoMixingMasternode.addr.ToString(), pfrom->addr.ToString());
147145
return;
148146
}
149147

@@ -181,7 +179,6 @@ void CPrivateSendClientSession::ProcessMessage(CNode* pfrom, const std::string&
181179

182180
if (!mixingMasternode) return;
183181
if (mixingMasternode->pdmnState->addr != pfrom->addr) {
184-
//LogPrint(BCLog::PRIVATESEND, "DSFINALTX -- message doesn't match current Masternode: infoMixingMasternode %s addr %s\n", infoMixingMasternode.addr.ToString(), pfrom->addr.ToString());
185182
return;
186183
}
187184

src/privatesend/privatesend-server.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ void CPrivateSendServer::ProcessMessage(CNode* pfrom, const std::string& strComm
112112
// process every dsq only once
113113
for (const auto& q : vecPrivateSendQueue) {
114114
if (q == dsq) {
115-
// LogPrint(BCLog::PRIVATESEND, "DSQUEUE -- %s seen\n", dsq.ToString());
116115
return;
117116
}
118117
}

src/validation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,6 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params&
10401040
else if(nSubsidyBase < 5) nSubsidyBase = 5;
10411041
}
10421042

1043-
// LogPrintf("height %u diff %4.2f reward %d\n", nPrevHeight, dDiff, nSubsidyBase);
10441043
CAmount nSubsidy = nSubsidyBase * COIN;
10451044

10461045
// yearly decline of production by ~7.1% per year, projected ~18M coins max by year 2050+.

0 commit comments

Comments
 (0)