Skip to content

Commit

Permalink
+ count exec fee
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoin committed Feb 20, 2024
1 parent ff123fc commit 97ec817
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions device/hashrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func NewHashrateLog() *HashrateLogTable {
func (h *HashrateLogTable) loopPrintHashrate() {
for {
<-h.hsrtc.C
if h.current_blk == nil {
continue
}
var hei = h.current_blk.GetHeight()
var lphr = difficulty.ConvertHashToRate(hei, h.period_max_power_hash, h.blktm)
h.hxrate_show_count++
Expand All @@ -73,6 +76,9 @@ func (h *HashrateLogTable) loopPrintHashrate() {
h.logts[5] = average_hashrate
var ratio = big.NewFloat(float64(100))
ratio = ratio.Mul(ratio, big.NewFloat(0).SetInt(average_lphr))
if h.blk_rate.Sign() == 0 {
continue
}
ratio = ratio.Quo(ratio, big.NewFloat(0).SetInt(h.blk_rate))
percentf, _ := ratio.Float64()
h.logts[3] = fmt.Sprintf("%.6f%%", percentf)
Expand Down
2 changes: 1 addition & 1 deletion memtxpool/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (p *MemTxPool) checkDiamondCreate(newtx interfaces.Transaction, act *action
return fmt.Errorf("diamond create tx %s timestamp cannot more than now.", txhxhex)
}
// fee purity
if newtx.FeePurity() < mint.MinTransactionFeePurityOfOneByte {
if newtx.FeePurity() < mint.MinTransactionFeePurity {
return fmt.Errorf("diamond create tx %s handling fee is too low for miners to accept.", txhxhex)
}
// sign
Expand Down
2 changes: 1 addition & 1 deletion memtxpool/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type TxItem struct {
tx interfaces.Transaction
hash fields.Hash
size uint32
feepurity uint64
feepurity uint32

next *TxItem
prev *TxItem
Expand Down

0 comments on commit 97ec817

Please sign in to comment.