Skip to content

Commit

Permalink
eth/api_debug: comment of SetTrieFlushInterval
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed May 30, 2023
1 parent 9e40481 commit 2709a71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/api_debug.go
Expand Up @@ -395,6 +395,9 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error

// SetTrieFlushInterval configures how often in-memory tries are persisted
// to disk. The value is in terms of block processing time, not wall clock.
// If the value is shorter than the block generation time, or even 0 or negative,
// the node will flush trie after processing each block.
// Its behavior is the same as that of an archive node, so please use it with caution.
func (api *DebugAPI) SetTrieFlushInterval(interval string) error {
t, err := time.ParseDuration(interval)
if err != nil {
Expand All @@ -406,6 +409,5 @@ func (api *DebugAPI) SetTrieFlushInterval(interval string) error {

// GetTrieFlushInterval gets the current value of in-memroy tries flush interval
func (api *DebugAPI) GetTrieFlushInterval() string {
interval := api.eth.blockchain.GetTrieFlushInterval()
return interval.String()
return api.eth.blockchain.GetTrieFlushInterval().String()
}

0 comments on commit 2709a71

Please sign in to comment.