Skip to content

Commit dc891c1

Browse files
committed
Merge branch 'development' of https://github.com/FactomProject/FactomCode into development
Conflicts: database/ldb/ablock.go database/ldb/dblock.go
2 parents 208148c + efd9f2f commit dc891c1

8 files changed

Lines changed: 10 additions & 18 deletions

File tree

consensus/plistmgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (plMgr *ProcessListMgr) InitProcessListFromOrphanMap() error {
111111
// Create a new process list item and add it to the MyProcessList
112112
func (plMgr *ProcessListMgr) AddMyProcessListItem(msg wire.FtmInternalMsg, hash *wire.ShaHash, msgType byte) (ack *wire.MsgAcknowledgement, err error) {
113113

114-
ack = wire.NewMsgAcknowledgement(plMgr.NextDBlockHeight, uint32(plMgr.MyProcessList.nextIndex), hash, msgType) //??
114+
ack = wire.NewMsgAcknowledgement(plMgr.NextDBlockHeight, uint32(plMgr.MyProcessList.nextIndex), hash, msgType)
115115
// Sign the ack using server private keys
116116
bytes, _ := ack.GetBinaryForSignature()
117117
ack.Signature = *plMgr.SignAck(bytes).Sig

database/ldb/ablock.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ func (db *LevelDb) FetchAllABlocks() (aBlocks []common.AdminBlock, err error) {
9393
if err != nil {
9494
return nil, err
9595
}
96-
aBlock.ABHash = common.Sha(iter.Value()) //to be optimized??
96+
//TODO: to be optimized??
97+
aBlock.ABHash = common.Sha(iter.Value())
9798

9899
aBlockSlice = append(aBlockSlice, aBlock)
99100

database/ldb/dblock.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ func (db *LevelDb) FetchAllDBlocks() (dBlocks []common.DirectoryBlock, err error
379379
if err != nil {
380380
return nil, err
381381
}
382-
dBlock.DBHash = common.Sha(iter.Value()) //to be optimized??
382+
//TODO: to be optimized??
383+
dBlock.DBHash = common.Sha(iter.Value())
383384

384385
dBlockSlice = append(dBlockSlice, dBlock)
385386

database/ldb/leveldb.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ const (
6868
STATUS_PROCESSED
6969
)
7070

71-
// chain type key prefix ??
7271
var currentChainType uint32 = 1
7372

7473
var isLookupDB bool = true // to be put in property file
@@ -100,7 +99,6 @@ type LevelDb struct {
10099
}
101100
var CurrentDBVersion int32 = 1
102101

103-
//to be removed??
104102
func OpenLevelDB(dbpath string, create bool) (pbdb database.Db, err error) {
105103
return openDB(dbpath, create)
106104
}
@@ -116,8 +114,6 @@ func openDB(dbpath string, create bool) (pbdb database.Db, err error) {
116114

117115
// Initialize db
118116
db.lastDirBlkHeight = -1
119-
// db.txUpdateMap = map[wire.ShaHash]*txUpdateObj{}
120-
// db.txSpentUpdateMap = make(map[wire.ShaHash]*spentTxUpdate)
121117

122118
pbdb = &db
123119
}
@@ -153,11 +149,9 @@ func openDB(dbpath string, create bool) (pbdb database.Db, err error) {
153149
}
154150
}
155151

156-
//myCache := cache.NewEmptyCache()
152+
157153
opts := &opt.Options{
158-
// BlockCacher: opt.DefaultBlockCacher,
159154
Compression: opt.NoCompression,
160-
// OpenFilesCacher: opt.DefaultOpenFilesCacher,
161155
}
162156

163157
switch dbversion {

factomd/factomd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func factomdMain() error {
6969
// Start the wsapi server module in a separate go-routine
7070
wsapi.Start(db, inMsgQueue)
7171

72-
// wait till the initialization is complete in processor - to be improved??
72+
// wait till the initialization is complete in processor
7373
hash, _ := db.FetchDBHashByHeight(0)
7474
if hash != nil {
7575
for true {

process/processor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
inCtlMsgQueue chan wire.FtmInternalMsg //incoming message queue for factom control messages
4848
outCtlMsgQueue chan wire.FtmInternalMsg //outgoing message queue for factom control messages
4949

50-
// To be moved to ftmMemPool??
50+
//TODO: To be moved to ftmMemPool??
5151
chainIDMap map[string]*common.EChain // ChainIDMap with chainID string([32]byte) as key
5252
commitChainMap = make(map[string]*common.CommitChain, 0)
5353
commitEntryMap = make(map[string]*common.CommitEntry, 0)
@@ -859,7 +859,6 @@ func buildBlocks() error {
859859
// Directory Block chain
860860
procLog.Debug("in buildBlocks")
861861
dbBlock := newDirectoryBlock(dchain)
862-
// Check block hash if genesis block here??
863862

864863
// Generate the inventory vector and relay it.
865864
binary, _ := dbBlock.MarshalBinary()

process/syncup.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func procesECBlock(msg *wire.MsgECBlock) error {
8989
//Add it to mem pool before saving it in db
9090
fMemPool.addBlockMsg(msg, msg.ECBlock.Header.Hash().String())
9191

92-
// for debugging??
9392
procLog.Debug("SyncUp: MsgCBlock DBHeight=", msg.ECBlock.Header.DBHeight)
9493

9594
return nil
@@ -111,7 +110,6 @@ func processEBlock(msg *wire.MsgEBlock) error {
111110
//Add it to mem pool before saving it in db
112111
fMemPool.addBlockMsg(msg, msg.EBlk.KeyMR().String()) // store it in mem pool with MR as the key
113112

114-
// for debugging??
115113
procLog.Debug("SyncUp: MsgEBlock DBHeight=", msg.EBlk.Header.DBHeight)
116114

117115
return nil
@@ -169,8 +167,7 @@ func validateAndStoreBlocks(fMemPool *ftmMemPool, db database.Db, dchain *common
169167
} else {
170168
time.Sleep(time.Duration(sleeptime * 1000000)) // Nanoseconds for duration
171169

172-
//send an internal msg to sync up with peers
173-
// ??
170+
//TODO: send an internal msg to sync up with peers
174171
}
175172

176173
}

process/timer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (bt *BlockTimer) StartBlockTimer() {
3333
for i := 0; i < 10; i++ {
3434
eomMsg := &wire.MsgInt_EOM{
3535
EOM_Type: wire.END_MINUTE_1 + byte(i),
36-
NextDBlockHeight: bt.nextDBlockHeight, //??
36+
NextDBlockHeight: bt.nextDBlockHeight,
3737
}
3838

3939
//send the end-of-minute message to processor

0 commit comments

Comments
 (0)