mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
31 lines
681 B
Go
31 lines
681 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package proposervm
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/node/vms/proposervm/indexer"
|
|
chain "github.com/luxfi/vm/chain"
|
|
)
|
|
|
|
var _ indexer.BlockServer = (*VM)(nil)
|
|
|
|
// Note: this is a contention heavy call that should be avoided
|
|
// for frequent/repeated indexer ops
|
|
func (vm *VM) GetFullPostForkBlock(ctx context.Context, blkID ids.ID) (chain.Block, error) {
|
|
vm.lock.Lock()
|
|
defer vm.lock.Unlock()
|
|
|
|
return vm.getPostForkBlock(ctx, blkID)
|
|
}
|
|
|
|
func (vm *VM) Commit() error {
|
|
vm.lock.Lock()
|
|
defer vm.lock.Unlock()
|
|
|
|
return vm.db.Commit()
|
|
}
|