We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4dd1096 commit def64c2Copy full SHA for def64c2
src/accountsdb/account_store.zig
@@ -263,6 +263,7 @@ pub const ThreadSafeAccountMap = struct {
263
pub fn getLatest(self: *ThreadSafeAccountMap, address: Pubkey) !?Account {
264
self.rwlock.lockShared();
265
defer self.rwlock.unlockShared();
266
+
267
const list = self.pubkey_map.get(address) orelse return null;
268
if (list.items.len == 0) return null;
269
return asAccount(list.items[0][1]);
@@ -284,6 +285,9 @@ pub const ThreadSafeAccountMap = struct {
284
285
address: Pubkey,
286
put_account: AccountSharedData,
287
) !void {
288
+ self.rwlock.lock();
289
+ defer self.rwlock.unlock();
290
291
const account = try put_account.clone(self.allocator);
292
293
slot_map: {
0 commit comments