• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revisionc3dc15de4b7b56d8d8412b6048f624f6cf25fbf0 (tree)
Time2019-06-24 20:49:31
AuthorChengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update

Change Summary

Incremental Difference

--- a/database/wallet_store.go
+++ b/database/wallet_store.go
@@ -165,15 +165,17 @@ func (store *WalletStore) GetAccountByAccountID(accountID string) []byte {
165165 // DeleteTransactions delete transactions when orphan block rollback
166166 func (store *WalletStore) DeleteTransactions(height uint64) {
167167 tmpTx := query.AnnotatedTx{}
168+ batch := store.DB.NewBatch()
168169 txIter := store.DB.IteratorPrefix(calcDeleteKey(height))
169170 defer txIter.Release()
170171
171172 for txIter.Next() {
172173 if err := json.Unmarshal(txIter.Value(), &tmpTx); err == nil {
173- store.batch.Delete(calcTxIndexKey(tmpTx.ID.String()))
174+ batch.Delete(calcTxIndexKey(tmpTx.ID.String()))
174175 }
175- store.batch.Delete(txIter.Key())
176+ batch.Delete(txIter.Key())
176177 }
178+ batch.Write()
177179 }
178180
179181 // SetTransaction set raw transaction by block height and tx position
Show on old repository browser