This commit is contained in:
Ian Norden
2020-06-03 15:46:34 -05:00
parent 24b29cadf6
commit 9427a62532
8 changed files with 319 additions and 4 deletions
+2 -2
View File
@@ -43,8 +43,7 @@ func (b *Batch) Put(key []byte, value []byte) (err error) {
if err != nil {
return err
}
_, err = b.tx.Exec(putPgStr, mhKey, value)
if err != nil {
if _, err = b.tx.Exec(putPgStr, mhKey, value); err != nil {
return err
}
b.size += len(value)
@@ -89,6 +88,7 @@ func (b *Batch) Replay(w ethdb.KeyValueWriter) error {
// Reset satisfies the ethdb.Batch interface
// Reset resets the batch for reuse
// This should be called after every write
func (b *Batch) Reset() {
var err error
b.tx, err = b.db.Beginx()