@@ -53,8 +53,8 @@ func processFBlock(msg *wire.MsgFBlock) error {
5353 key , _ := msg .SC .GetHash ().MarshalText ()
5454 //Add it to mem pool before saving it in db
5555 fMemPool .addBlockMsg (msg , string (key )) // stored in mem pool with the MR as the key
56-
57- procLog .Debugf ("SyncUp: MsgFBlock=%s\n " , spew .Sdump (msg .SC ))
56+
57+ procLog .Debugf ("SyncUp: MsgFBlock=%s\n " , spew .Sdump (msg .SC ))
5858
5959 return nil
6060
@@ -89,11 +89,9 @@ func procesECBlock(msg *wire.MsgECBlock) error {
8989
9090 //Add it to mem pool before saving it in db
9191 fMemPool .addBlockMsg (msg , msg .ECBlock .KeyMR ().String ())
92-
93-
9492
9593 // for debugging??
96- procLog .Debugf ("SyncUp: msg.ECBlock.KeyMR().String()=%s\n " , msg .ECBlock .KeyMR ().String ())
94+ procLog .Debugf ("SyncUp: msg.ECBlock.KeyMR().String()=%s\n " , msg .ECBlock .KeyMR ().String ())
9795 procLog .Debugf ("SyncUp: MsgCBlock=%s\n " , spew .Sdump (msg .ECBlock ))
9896
9997 return nil
@@ -108,11 +106,11 @@ func processEBlock(msg *wire.MsgEBlock) error {
108106 if nodeMode == common .SERVER_NODE {
109107 return errors .New ("Server received msg:" + msg .Command ())
110108 }
111- /*
112- if msg.EBlk.Header.DBHeight >= dchain.NextBlockHeight || msg.EBlk.Header.DBHeight < 0 {
113- return errors.New("MsgEBlock has an invalid DBHeight:" + strconv.Itoa(int(msg.EBlk.Header.DBHeight)))
114- }
115- */
109+ /*
110+ if msg.EBlk.Header.DBHeight >= dchain.NextBlockHeight || msg.EBlk.Header.DBHeight < 0 {
111+ return errors.New("MsgEBlock has an invalid DBHeight:" + strconv.Itoa(int(msg.EBlk.Header.DBHeight)))
112+ }
113+ */
116114 //Add it to mem pool before saving it in db
117115 msg .EBlk .BuildMerkleRoot ()
118116 fMemPool .addBlockMsg (msg , msg .EBlk .MerkleRoot .String ()) // store it in mem pool with MR as the key
@@ -203,21 +201,21 @@ func validateBlocksFromMemPool(b *common.DirectoryBlock, fMemPool *ftmMemPool, d
203201 return false
204202 }
205203 case achain .ChainID .String ():
206- if msg , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
204+ if msg , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
207205 return false
208206 } else {
209207 // validate signature of the previous dir block
210208 aBlkMsg , _ := msg .(* wire.MsgABlock )
211- if ! validateDBSignature (aBlkMsg .ABlk , dchain ) {
209+ if ! validateDBSignature (aBlkMsg .ABlk , dchain ) {
212210 return false
213211 }
214212 }
215213 case fchain .ChainID .String ():
216- if _ , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
214+ if _ , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
217215 return false
218216 }
219217 default :
220- if msg , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
218+ if msg , ok := fMemPool .blockpool [dbEntry .MerkleRoot .String ()]; ! ok {
221219 return false
222220 } else {
223221 eBlkMsg , _ := msg .(* wire.MsgEBlock )
@@ -226,7 +224,7 @@ func validateBlocksFromMemPool(b *common.DirectoryBlock, fMemPool *ftmMemPool, d
226224 if _ , foundInMemPool := fMemPool .blockpool [ebEntry .EntryHash .String ()]; ! foundInMemPool {
227225 // continue if the entry arleady exists in db
228226 entry , _ := db .FetchEntryByHash (ebEntry .EntryHash )
229- if entry == nil {
227+ if entry == nil {
230228 return false
231229 }
232230 }
0 commit comments