Skip to content

Commit

Permalink
cleanup leftovers from unused TransactionHandler dataDir
Browse files Browse the repository at this point in the history
t.dataDir stopped being used in be824ae
    "clean commented codeblocks..."
but these leftovers were left behind
  • Loading branch information
altergui committed May 16, 2024
1 parent 9f3def4 commit 7b18fa9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
10 changes: 2 additions & 8 deletions vochain/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ const (

// StateDataDir is the subdirectory inside app.DataDir where State data will be saved
StateDataDir = "vcstate"
// TxHandlerDataDir is the subdirectory inside app.DataDir where TransactionHandler data will be saved
TxHandlerDataDir = "txHandler"
// TxHandlerDataDir is the subdirectory inside app.DataDir where Snapshots data will be saved
// SnapshotsDataDir is the subdirectory inside app.DataDir where Snapshots data will be saved
SnapshotsDataDir = "snapshots"
)

Expand Down Expand Up @@ -146,11 +144,7 @@ func NewBaseApplication(vochainCfg *config.VochainCfg) (*BaseApplication, error)
istc := ist.NewISTC(state)

// Create the transaction handler for checking and processing transactions
transactionHandler := transaction.NewTransactionHandler(
state,
istc,
filepath.Join(vochainCfg.DataDir, TxHandlerDataDir),
)
transactionHandler := transaction.NewTransactionHandler(state, istc)

snaps, err := snapshot.NewManager(filepath.Join(vochainCfg.DataDir, SnapshotsDataDir), vochainCfg.StateSyncChunkSize)
if err != nil {
Expand Down
6 changes: 1 addition & 5 deletions vochain/cometbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,7 @@ func (app *BaseApplication) RestoreStateFromSnapshot(snap *snapshot.Snapshot) er

istc := ist.NewISTC(newState)
// Create the transaction handler for checking and processing transactions
transactionHandler := transaction.NewTransactionHandler(
newState,
istc,
filepath.Join(app.dataDir, TxHandlerDataDir),
)
transactionHandler := transaction.NewTransactionHandler(newState, istc)

// This looks racy but actually it's OK, since State Sync happens during very early init,
// when the app is blocked waiting for cometbft to finish startup.
Expand Down
9 changes: 3 additions & 6 deletions vochain/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ type TransactionHandler struct {
state *vstate.State
// istc is the internal state transition controller
istc *ist.Controller
// dataDir is the path for storing some files
dataDir string
}

// NewTransactionHandler creates a new TransactionHandler.
func NewTransactionHandler(state *vstate.State, istc *ist.Controller, dataDir string) *TransactionHandler {
func NewTransactionHandler(state *vstate.State, istc *ist.Controller) *TransactionHandler {
return &TransactionHandler{
state: state,
dataDir: dataDir,
istc: istc,
state: state,
istc: istc,
}
}

Expand Down

0 comments on commit 7b18fa9

Please sign in to comment.