Skip to content

Commit

Permalink
Remove All Batch DB Calls (prysmaticlabs#4775)
Browse files Browse the repository at this point in the history
* remove all batch calls
  • Loading branch information
nisdas authored and cryptomental committed Feb 28, 2020
1 parent b5fb7a7 commit 0f1f4f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/db/kv/attestations.go
Expand Up @@ -95,7 +95,7 @@ func (k *Store) HasAttestation(ctx context.Context, attDataRoot [32]byte) bool {
func (k *Store) DeleteAttestation(ctx context.Context, attDataRoot [32]byte) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.DeleteAttestation")
defer span.End()
return k.db.Batch(func(tx *bolt.Tx) error {
return k.db.Update(func(tx *bolt.Tx) error {
bkt := tx.Bucket(attestationsBucket)
enc := bkt.Get(attDataRoot[:])
if enc == nil {
Expand Down Expand Up @@ -151,7 +151,7 @@ func (k *Store) SaveAttestation(ctx context.Context, att *ethpb.Attestation) err
return err
}

err := k.db.Batch(func(tx *bolt.Tx) error {
err := k.db.Update(func(tx *bolt.Tx) error {
attDataRoot, err := ssz.HashTreeRoot(att.Data)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/kv/blocks.go
Expand Up @@ -206,7 +206,7 @@ func (k *Store) HasBlock(ctx context.Context, blockRoot [32]byte) bool {
func (k *Store) DeleteBlock(ctx context.Context, blockRoot [32]byte) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.DeleteBlock")
defer span.End()
return k.db.Batch(func(tx *bolt.Tx) error {
return k.db.Update(func(tx *bolt.Tx) error {
bkt := tx.Bucket(blocksBucket)
enc := bkt.Get(blockRoot[:])
if enc == nil {
Expand Down

0 comments on commit 0f1f4f5

Please sign in to comment.