Skip to content

Commit

Permalink
kad: Update local memory store only if the query is put_value
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv committed Apr 18, 2024
1 parent 1f38a1b commit 96e827b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/protocol/libp2p/kademlia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ impl Kademlia {
Some(KademliaCommand::PutRecord { record, query_id, peers }) => {
tracing::debug!(target: LOG_TARGET, ?query_id, key = ?record.key, "store record to DHT");

self.store.put(record.clone());
let key = Key::new(record.key.clone());


Expand All @@ -761,6 +760,8 @@ impl Kademlia {
peers
);
} else {
self.store.put(record.clone());

self.engine.start_put_record(
query_id,
record,
Expand Down

0 comments on commit 96e827b

Please sign in to comment.