Revert unrelated changes

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-09-08 16:48:31 +01:00
parent 7c2832161c
commit f439be39bd
2 changed files with 29 additions and 49 deletions

View File

@@ -977,9 +977,9 @@ NetworkOPsImp::setTimer(
e.value() != boost::asio::error::operation_aborted)
{
// Try again later and hope for the best.
JLOG(m_journal.error()) << "Timer got error '"
<< e.message()
<< "'. Restarting timer.";
JLOG(m_journal.error())
<< "Timer got error '" << e.message()
<< "'. Restarting timer.";
onError();
}
}))
@@ -1022,9 +1022,8 @@ NetworkOPsImp::setClusterTimer()
void
NetworkOPsImp::setAccountHistoryJobTimer(SubAccountHistoryInfoWeak subInfo)
{
JLOG(m_journal.debug())
<< "Scheduling AccountHistory job for account "
<< toBase58(subInfo.index_->accountId_);
JLOG(m_journal.debug()) << "Scheduling AccountHistory job for account "
<< toBase58(subInfo.index_->accountId_);
using namespace std::chrono_literals;
setTimer(
accountHistoryTxTimer_,
@@ -1056,8 +1055,7 @@ NetworkOPsImp::processHeartbeatTimer()
std::stringstream ss;
ss << "Node count (" << numPeers << ") has fallen "
<< "below required minimum (" << minPeerCount_ << ").";
JLOG(m_journal.warn())
<< ss.str();
JLOG(m_journal.warn()) << ss.str();
CLOG(clog.ss()) << "set mode to DISCONNECTED: " << ss.str();
}
else
@@ -1080,8 +1078,7 @@ NetworkOPsImp::processHeartbeatTimer()
{
setMode(OperatingMode::CONNECTED);
JLOG(m_journal.info())
<< "Node count (" << numPeers
<< ") is sufficient.";
<< "Node count (" << numPeers << ") is sufficient.";
CLOG(clog.ss()) << "setting mode to CONNECTED based on " << numPeers
<< " peers. ";
}
@@ -1226,16 +1223,15 @@ NetworkOPsImp::submitTransaction(std::shared_ptr<STTx const> const& iTrans)
if (validity != Validity::Valid)
{
JLOG(m_journal.warn()) << "Submitted transaction invalid: "
<< log::param("Reason", reason);
JLOG(m_journal.warn())
<< "Submitted transaction invalid: " << reason;
return;
}
}
catch (std::exception const& ex)
{
JLOG(m_journal.warn()) << "Exception checking transaction "
<< log::param("TransactionID", txid) << ": "
<< log::param("Reason", ex.what());
JLOG(m_journal.warn())
<< "Exception checking transaction " << txid << ": " << ex.what();
return;
}
@@ -1258,9 +1254,7 @@ NetworkOPsImp::preProcessTransaction(std::shared_ptr<Transaction>& transaction)
if ((newFlags & HashRouterFlags::BAD) != HashRouterFlags::UNDEFINED)
{
// cached bad
JLOG(m_journal.warn())
<< log::param("TransactionID", transaction->getID())
<< ": cached bad!\n";
JLOG(m_journal.warn()) << transaction->getID() << ": cached bad!\n";
transaction->setStatus(INVALID);
transaction->setResult(temBAD_SIGNATURE);
return false;
@@ -1293,8 +1287,7 @@ NetworkOPsImp::preProcessTransaction(std::shared_ptr<Transaction>& transaction)
// Not concerned with local checks at this point.
if (validity == Validity::SigBad)
{
JLOG(m_journal.info()) << "Transaction has bad signature: "
<< log::param("Reason", reason);
JLOG(m_journal.info()) << "Transaction has bad signature: " << reason;
transaction->setStatus(INVALID);
transaction->setResult(temBAD_SIGNATURE);
app_.getHashRouter().setFlags(
@@ -1604,6 +1597,7 @@ NetworkOPsImp::apply(std::unique_lock<std::mutex>& batchLock)
else if (e.result == terQUEUED)
{
JLOG(m_journal.debug())
<< "Transaction is likely to claim a"
<< " fee, but is queued until fee drops";
e.transaction->setStatus(HELD);

View File

@@ -321,8 +321,7 @@ PeerImp::sendTxQueue()
std::for_each(txQueue_.begin(), txQueue_.end(), [&](auto const& hash) {
ht.add_hashes(hash.data(), hash.size());
});
JLOG(p_journal_.trace())
<< "sendTxQueue " << txQueue_.size();
JLOG(p_journal_.trace()) << "sendTxQueue " << txQueue_.size();
txQueue_.clear();
send(std::make_shared<Message>(ht, protocol::mtHAVE_TRANSACTIONS));
}
@@ -342,8 +341,7 @@ PeerImp::addTxQueue(uint256 const& hash)
}
txQueue_.insert(hash);
JLOG(p_journal_.trace())
<< "addTxQueue " << txQueue_.size();
JLOG(p_journal_.trace()) << "addTxQueue " << txQueue_.size();
}
void
@@ -355,8 +353,7 @@ PeerImp::removeTxQueue(uint256 const& hash)
std::bind(&PeerImp::removeTxQueue, shared_from_this(), hash));
auto removed = txQueue_.erase(hash);
JLOG(p_journal_.trace())
<< "removeTxQueue " << removed;
JLOG(p_journal_.trace()) << "removeTxQueue " << removed;
}
void
@@ -497,8 +494,7 @@ PeerImp::json()
default:
JLOG(p_journal_.warn())
<< "Unknown status: "
<< last_status.newstatus();
<< "Unknown status: " << last_status.newstatus();
}
}
@@ -622,7 +618,7 @@ PeerImp::fail(std::string const& reason)
{
std::string const n = name();
JLOG(journal_.warn()) << (n.empty() ? remote_address_.to_string() : n)
<< " failed: " << reason;
<< " failed: " << reason;
}
close();
}
@@ -671,8 +667,7 @@ PeerImp::setTimer()
if (ec)
{
JLOG(journal_.error())
<< "setTimer: " << ec.message();
JLOG(journal_.error()) << "setTimer: " << ec.message();
return;
}
timer_.async_wait(bind_executor(
@@ -703,8 +698,7 @@ PeerImp::onTimer(error_code const& ec)
if (ec)
{
// This should never happen
JLOG(journal_.error())
<< "onTimer: " << ec.message();
JLOG(journal_.error()) << "onTimer: " << ec.message();
return close();
}
@@ -776,8 +770,7 @@ PeerImp::doAccept()
read_buffer_.size() == 0,
"ripple::PeerImp::doAccept : empty read buffer");
JLOG(journal_.debug()) << "doAccept: "
<< remote_address_;
JLOG(journal_.debug()) << "doAccept: " << remote_address_;
auto const sharedValue = makeSharedValue(*stream_ptr_, journal_);
@@ -786,8 +779,7 @@ PeerImp::doAccept()
if (!sharedValue)
return fail("makeSharedValue: Unexpected failure");
JLOG(journal_.info()) << "Protocol: "
<< to_string(protocol_);
JLOG(journal_.info()) << "Protocol: " << to_string(protocol_);
JLOG(journal_.info()) << "Public Key: "
<< toBase58(TokenType::NodePublic, publicKey_);
@@ -1297,9 +1289,8 @@ PeerImp::handleTransaction(
if (stx->isFlag(tfInnerBatchTxn) &&
getCurrentTransactionRules()->enabled(featureBatch))
{
JLOG(p_journal_.warn())
<< "Ignoring Network relayed Tx containing "
"tfInnerBatchTxn (handleTransaction).";
JLOG(p_journal_.warn()) << "Ignoring Network relayed Tx containing "
"tfInnerBatchTxn (handleTransaction).";
fee_.update(Resource::feeModerateBurdenPeer, "inner batch txn");
return;
}
@@ -1314,8 +1305,7 @@ PeerImp::handleTransaction(
if (any(flags & HashRouterFlags::BAD))
{
fee_.update(Resource::feeUselessData, "known bad");
JLOG(p_journal_.debug())
<< "Ignoring known bad tx " << txID;
JLOG(p_journal_.debug()) << "Ignoring known bad tx " << txID;
}
// Erase only if the server has seen this tx. If the server has not
@@ -1393,8 +1383,7 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMGetLedger> const& m)
{
auto badData = [&](std::string const& msg) {
fee_.update(Resource::feeInvalidData, "get_ledger " + msg);
JLOG(p_journal_.warn())
<< "TMGetLedger: " << msg;
JLOG(p_journal_.warn()) << "TMGetLedger: " << msg;
};
auto const itype{m->itype()};
@@ -1593,8 +1582,7 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMLedgerData> const& m)
{
auto badData = [&](std::string const& msg) {
fee_.update(Resource::feeInvalidData, msg);
JLOG(p_journal_.warn())
<< "TMLedgerData: " << msg;
JLOG(p_journal_.warn()) << "TMLedgerData: " << msg;
};
// Verify ledger hash
@@ -1876,9 +1864,7 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMStatusChange> const& m)
}
if (peerChangedLedgers)
{
JLOG(p_journal_.debug())
<< "LCL is "
<< closedLedgerHash;
JLOG(p_journal_.debug()) << "LCL is " << closedLedgerHash;
}
else
{