mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 07:20:55 +01:00
modules/federation/sender: Consistent origin from node::id; fix curtxn assignment.
This commit is contained in:
parent
df7b6f0ca9
commit
1846dd379d
2 changed files with 11 additions and 2 deletions
|
@ -195,6 +195,7 @@ try
|
|||
|
||||
txns.emplace_back(*this, std::move(content), std::move(opts));
|
||||
const unwind::nominal::assertion na;
|
||||
curtxn = &txns.back();
|
||||
q.clear();
|
||||
recv_action.notify_one();
|
||||
return true;
|
||||
|
@ -404,8 +405,11 @@ recv_timeout(txn &txn,
|
|||
void
|
||||
remove_node(const node &node)
|
||||
{
|
||||
const string_view &id{node.id};
|
||||
const auto it{nodes.find(id)};
|
||||
const auto it
|
||||
{
|
||||
nodes.find(node.origin())
|
||||
};
|
||||
|
||||
assert(it != end(nodes));
|
||||
nodes.erase(it);
|
||||
}
|
||||
|
|
|
@ -80,6 +80,11 @@ struct node
|
|||
txn *curtxn {nullptr};
|
||||
bool err {false};
|
||||
|
||||
string_view origin() const
|
||||
{
|
||||
return id.host();
|
||||
};
|
||||
|
||||
bool flush();
|
||||
void push(std::shared_ptr<unit>);
|
||||
|
||||
|
|
Loading…
Reference in a new issue