Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10276 from EOSIO/sk-dev-rocksdb-iterator-bug
Browse files Browse the repository at this point in the history
Ensure container.size() > 0 before initiating RocksDB writes/deletes
  • Loading branch information
nksanthosh authored Apr 23, 2021
2 parents fa0208b + 45e79bf commit e73df67
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/chain_kv/include/b1/session/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,15 @@ void session<Parent>::commit() {
updates.emplace(p.first, p.second.value);
}
}

ds.erase(deletes);
ds.write(updates);

if (deletes.size() > 0) {
ds.erase(deletes);
}

if (updates.size() > 0) {
ds.write(updates);
}

clear();
};

Expand Down

0 comments on commit e73df67

Please sign in to comment.