mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Move recognized_id from a channel to an async lambda
Fixes a race condition. Also fixes recognizing batch IDs.
This commit is contained in:
@@ -68,7 +68,7 @@ impl<'a, D: Db> MainDb<'a, D> {
|
||||
) {
|
||||
let key = Self::batches_in_block_key(network, block.0);
|
||||
let Some(mut existing) = txn.get(&key) else {
|
||||
txn.put(&key, block.0);
|
||||
txn.put(&key, id);
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ impl<'a, D: Db> MainDb<'a, D> {
|
||||
return;
|
||||
}
|
||||
|
||||
existing.extend(block.0);
|
||||
existing.extend(id);
|
||||
txn.put(&key, existing);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user