mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-21 02:55:50 +00:00
Control transaction dispatch rate:
Do not process a transaction received from a peer if it has
been processed within the past ten seconds.
Increase the number of transaction handlers that can be in
flight in the job queue and decrease the relative cost for
peers to share transaction and ledger data.
Additionally, make better use of resources by adjusting the
number of threads we initialize, by reverting commit
68b8ffdb63.
Performance counter modifications:
* Create and display counters to track:
1) Pending transaction limit overruns.
2) Total peer disconnections.
3) Peers disconnections due to resource consumption.
Avoid a potential double-free in Json library.
This commit is contained in:
committed by
Scott Schurr
parent
49b5c42e85
commit
76ad06ef47
@@ -264,6 +264,24 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(!router.shouldRecover(key1));
|
||||
}
|
||||
|
||||
void
|
||||
testProcess()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 5s, 5);
|
||||
uint256 const key(1);
|
||||
HashRouter::PeerShortID peer = 1;
|
||||
int flags;
|
||||
|
||||
BEAST_EXPECT(router.shouldProcess(key, peer, flags, 1s));
|
||||
BEAST_EXPECT(! router.shouldProcess(key, peer, flags, 1s));
|
||||
++stopwatch;
|
||||
++stopwatch;
|
||||
BEAST_EXPECT(router.shouldProcess(key, peer, flags, 1s));
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
void
|
||||
@@ -275,6 +293,7 @@ public:
|
||||
testSetFlags();
|
||||
testRelay();
|
||||
testRecover();
|
||||
testProcess();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user