Skip to content

Commit

Permalink
Non ethoFS enabled node bug fix - pers trie
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-JamesR committed Dec 7, 2020
1 parent 5f9e2fd commit 1707e88
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/blockchain_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

// block communication channel declaration
var blockCommunication chan<- *types.Block
var isInitialized = false

// insertStats tracks and reports on block insertion.
type insertStats struct {
Expand Down Expand Up @@ -76,7 +77,7 @@ func (st *insertStats) report(chain []*types.Block, index int, dirty common.Stor
}
log.Info("Imported new chain segment", context...)

if len(chain) == 1 {
if isInitialized && len(chain) == 1 {
//ethofs.NewBlock(chain[0]) // ethoFS new block event handler
sendNewBlockCommunication(chain[0])
}
Expand All @@ -89,6 +90,7 @@ func (st *insertStats) report(chain []*types.Block, index int, dirty common.Stor
// Initialize new block comms
func InitializeBlockCommunication(newBlockReceiptChannel chan<- *types.Block) {
blockCommunication = newBlockReceiptChannel
isInitialized = true
}

// Send new block using comms
Expand Down
5 changes: 5 additions & 0 deletions ethofs/ethofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ var contractControllerAddress = common.HexToAddress("0xc38B47169950D8A28bC77a6Fa
var mainChannelString = "ethoFSPinningChannel_alpha11"
var defaultDataDir string
var ipcLocation string
var isInitialized = false

func IsInitialized() bool {
return isInitialized
}

func InitializeEthofs(initFlag bool, configFlag bool, nodeType string, blockCommunication chan *types.Block) {

Expand Down
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const logo = `
,,,,,, ,,,,,,,,,
,,,,, ,,,,,,,,
,,,, ,,,,,,
,, ,,,, Kepler v1.4.1
,, ,,,, Kepler v1.4.2
,, ethoFS Enabled Node
,
`
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 4 // Minor version component of the current release
VersionPatch = 1 // Patch version component of the current release
VersionPatch = 2 // Patch version component of the current release
VersionMeta = "Ether1-Kepler" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 1707e88

Please sign in to comment.