mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-07 10:47:05 +00:00
fix: Always charge peer on strand
This commit is contained in:
@@ -392,8 +392,14 @@ PeerImp::removeTxQueue(uint256 const& hash)
|
||||
void
|
||||
PeerImp::charge(Resource::Charge const& fee, std::string const& context)
|
||||
{
|
||||
if (!strand_.running_in_this_thread())
|
||||
{
|
||||
post(strand_, [self = shared_from_this(), fee, context]() { self->charge(fee, context); });
|
||||
return;
|
||||
}
|
||||
|
||||
if ((usage_.charge(fee, context) == Resource::Disposition::Drop) &&
|
||||
usage_.disconnect(pJournal_) && strand_.running_in_this_thread())
|
||||
usage_.disconnect(pJournal_))
|
||||
{
|
||||
// Sever the connection
|
||||
overlay_.incPeerDisconnectCharges();
|
||||
|
||||
Reference in New Issue
Block a user