Skip to content

Commit 3b1b983

Browse files
committed
New Coinbase code, updates to screen
1 parent f6d08f7 commit 3b1b983

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

process/processor.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func initProcessor() {
108108
wire.FChainID = common.NewHash()
109109
wire.FChainID.SetBytes(common.FACTOID_CHAINID)
110110

111-
FactoshisPerCredit = 666667 // .001 / .15 * 100000000 (assuming a Factoid is .15 cents, entry credit = .1 cents
111+
FactoshisPerCredit = 66666 // .001 / .15 * 100000000 (assuming a Factoid is .15 cents, entry credit = .1 cents
112112

113113
// init Directory Block Chain
114114
initDChain()
@@ -226,14 +226,6 @@ func serveCtlMsgRequest(msg wire.FtmInternalMsg) error {
226226
// Serve incoming msg from inMsgQueue
227227
func serveMsgRequest(msg wire.FtmInternalMsg) error {
228228

229-
if msg.Command() == wire.CmdFBlock {
230-
fblock, ok := msg.(*wire.MsgFBlock)
231-
if ok {
232-
fmt.Printf("%s : Current chain height: %v\r", time.Now().Format(time.RFC3339), fblock.SC.GetDBHeight())
233-
}
234-
235-
}
236-
237229
switch msg.Command() {
238230
case wire.CmdCommitChain:
239231
msgCommitChain, ok := msg.(*wire.MsgCommitChain)
@@ -314,6 +306,15 @@ func serveMsgRequest(msg wire.FtmInternalMsg) error {
314306

315307
plMgr.AddMyProcessListItem(msgEom, nil, msgEom.EOM_Type)
316308
}
309+
fmt.Printf("\033[s") // save the cursor position
310+
fmt.Printf("\033[1;0H%80s","")
311+
fmt.Printf("\033[2;0H%80s","")
312+
fmt.Printf("\033[3;0H Minute %2v: %20s Current chain height: %7v ",
313+
msgEom.EOM_Type,
314+
time.Now().Format(time.RFC3339),
315+
dchain.NextDBHeight)
316+
fmt.Printf("\033[4;0H%80s","")
317+
fmt.Printf("\033[u") // restore the cursor positio
317318
}
318319

319320
case wire.CmdDirBlock:

process/syncup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ func storeBlocksFromMemPool(b *common.DirectoryBlock, fMemPool *ftmMemPool, db d
262262
}
263263
// Initialize the Factoid State
264264
err = common.FactoidState.AddTransactionBlock(fBlkMsg.SC)
265+
FactoshisPerCredit = fBlkMsg.SC.GetExchRate()
265266
if err != nil {
266-
panic("Failed to rebuild factoid state: " + err.Error())
267+
return err
267268
}
268269

269270
// for debugging

wsapi/wsapi.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ func handleChainHead(ctx *web.Context, chainid string) {
359359
}
360360

361361
c := new(chead)
362-
fmt.Println("DEBUG:", c)
363362
if mr, err := factomapi.ChainHead(chainid); err != nil {
364363
wsLog.Error(err)
365364
ctx.WriteHeader(httpBad)

0 commit comments

Comments
 (0)