mirror of
https://github.com/tendermint/tendermint.git
synced 2026-06-02 20:36:25 +00:00
call db.SetSync when necessary
This commit is contained in:
@@ -172,6 +172,9 @@ func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, s
|
||||
|
||||
// Done!
|
||||
bs.height = height
|
||||
|
||||
// Flush
|
||||
bs.db.SetSync(nil, nil)
|
||||
}
|
||||
|
||||
func (bs *BlockStore) saveBlockPart(height int, index int, part *types.Part) {
|
||||
@@ -213,7 +216,7 @@ func (bsj BlockStoreStateJSON) Save(db dbm.DB) {
|
||||
if err != nil {
|
||||
PanicSanity(Fmt("Could not marshal state bytes: %v", err))
|
||||
}
|
||||
db.Set(blockStoreKey, bytes)
|
||||
db.SetSync(blockStoreKey, bytes)
|
||||
}
|
||||
|
||||
func LoadBlockStoreStateJSON(db dbm.DB) BlockStoreStateJSON {
|
||||
|
||||
@@ -80,7 +80,7 @@ func (s *State) Copy() *State {
|
||||
func (s *State) Save() {
|
||||
s.mtx.Lock()
|
||||
defer s.mtx.Unlock()
|
||||
s.db.Set(stateKey, s.Bytes())
|
||||
s.db.SetSync(stateKey, s.Bytes())
|
||||
}
|
||||
|
||||
func (s *State) Equals(s2 *State) bool {
|
||||
|
||||
Reference in New Issue
Block a user