@@ -362,6 +362,9 @@ func (api *DebugAPI) getModifiedAccounts(startBlock, endBlock *types.Block) ([]c
362
362
// The (from, to) parameters are the sequence of blocks to search, which can go
363
363
// either forwards or backwards
364
364
func (api * DebugAPI ) GetAccessibleState (from , to rpc.BlockNumber ) (uint64 , error ) {
365
+ if api .eth .blockchain .TrieDB ().Scheme () == rawdb .PathScheme {
366
+ return 0 , errors .New ("state history is not yet available in path-based scheme" )
367
+ }
365
368
db := api .eth .ChainDb ()
366
369
var pivot uint64
367
370
if p := rawdb .ReadLastPivotNumber (db ); p != nil {
@@ -422,6 +425,9 @@ func (api *DebugAPI) GetAccessibleState(from, to rpc.BlockNumber) (uint64, error
422
425
// If the value is shorter than the block generation time, or even 0 or negative,
423
426
// the node will flush trie after processing each block (effectively archive mode).
424
427
func (api * DebugAPI ) SetTrieFlushInterval (interval string ) error {
428
+ if api .eth .blockchain .TrieDB ().Scheme () == rawdb .PathScheme {
429
+ return errors .New ("trie flush interval is undefined for path-based scheme" )
430
+ }
425
431
t , err := time .ParseDuration (interval )
426
432
if err != nil {
427
433
return err
@@ -431,6 +437,9 @@ func (api *DebugAPI) SetTrieFlushInterval(interval string) error {
431
437
}
432
438
433
439
// GetTrieFlushInterval gets the current value of in-memory trie flush interval
434
- func (api * DebugAPI ) GetTrieFlushInterval () string {
435
- return api .eth .blockchain .GetTrieFlushInterval ().String ()
440
+ func (api * DebugAPI ) GetTrieFlushInterval () (string , error ) {
441
+ if api .eth .blockchain .TrieDB ().Scheme () == rawdb .PathScheme {
442
+ return "" , errors .New ("trie flush interval is undefined for path-based scheme" )
443
+ }
444
+ return api .eth .blockchain .GetTrieFlushInterval ().String (), nil
436
445
}
0 commit comments