diff options
author | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-04-11 09:26:19 -0500 |
---|---|---|
committer | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-04-11 09:26:19 -0500 |
commit | ebbb900849cd5c7ecd471e298c049404c8898b27 (patch) | |
tree | df59d126238c469c0797c3e51770ccc87c71034d /src/nostr_service.cpp | |
parent | c8bb6c8f56e0c6d93c8623722ab932c04de882b5 (diff) |
Update existing unit tests for recent code changes
All preexisting unit tests now pass and test for the correct behavior.
Diffstat (limited to 'src/nostr_service.cpp')
-rw-r--r-- | src/nostr_service.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nostr_service.cpp b/src/nostr_service.cpp index e8f14f6..5b32beb 100644 --- a/src/nostr_service.cpp +++ b/src/nostr_service.cpp @@ -150,8 +150,9 @@ tuple<RelayList, RelayList> NostrService::publishEvent(shared_ptr<Event> event) } lock_guard<mutex> lock(this->_propertyMutex); + RelayList targetRelays = this->_activeRelays; vector<future<tuple<string, bool>>> publishFutures; - for (const string& relay : this->_activeRelays) + for (const string& relay : targetRelays) { promise<tuple<string, bool>> publishPromise; publishFutures.push_back(move(publishPromise.get_future())); @@ -196,7 +197,7 @@ tuple<RelayList, RelayList> NostrService::publishEvent(shared_ptr<Event> event) } } - size_t targetCount = this->_activeRelays.size(); + size_t targetCount = targetRelays.size(); size_t successfulCount = successfulRelays.size(); PLOG_INFO << "Published event to " << successfulCount << "/" << targetCount << " target relays."; |