diff --git a/vochain/app.go b/vochain/app.go index 857a57471..66b95d55b 100644 --- a/vochain/app.go +++ b/vochain/app.go @@ -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" ) @@ -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 { diff --git a/vochain/cometbft.go b/vochain/cometbft.go index 2f202d459..9ced5e90b 100644 --- a/vochain/cometbft.go +++ b/vochain/cometbft.go @@ -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. diff --git a/vochain/transaction/transaction.go b/vochain/transaction/transaction.go index 01bd0b140..99434271e 100644 --- a/vochain/transaction/transaction.go +++ b/vochain/transaction/transaction.go @@ -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, } }