mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Avoid processing transactions if we need a network ledger
Not processing tranasctions without a network ledger makes initial network synchronization faster.
This commit is contained in:
@@ -838,6 +838,12 @@ bool NetworkOPsImp::isValidated (std::uint32_t seq)
|
||||
void NetworkOPsImp::submitTransaction (
|
||||
Job&, STTx::pointer iTrans, stCallback callback)
|
||||
{
|
||||
if (isNeedNetworkLedger ())
|
||||
{
|
||||
// Nothing we can do if we've never been in sync
|
||||
return;
|
||||
}
|
||||
|
||||
// this is an asynchronous interface
|
||||
Serializer s;
|
||||
iTrans->add (s);
|
||||
|
||||
@@ -972,6 +972,14 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMEndpoints> const& m)
|
||||
void
|
||||
PeerImp::onMessage (std::shared_ptr <protocol::TMTransaction> const& m)
|
||||
{
|
||||
|
||||
if (getApp().getOPs().isNeedNetworkLedger ())
|
||||
{
|
||||
// If we've never been in synch, there's nothing we can do
|
||||
// with a transaction
|
||||
return;
|
||||
}
|
||||
|
||||
Serializer s (m->rawtransaction ());
|
||||
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user