Skip to content

Commit

Permalink
Merge branch 'master' of github.com:btcboost/copernicus into yyx
Browse files Browse the repository at this point in the history
  • Loading branch information
ludete committed Apr 21, 2018
2 parents a0c97a2 + 721527c commit e83852d
Show file tree
Hide file tree
Showing 10 changed files with 594 additions and 638 deletions.
4 changes: 4 additions & 0 deletions conf/init.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ connectTimeout = 10
dir = tmp
level = 2

[mining]
# select from ancestorfee/ancestorfeerate
strategy = ancestorfeerate


4 changes: 2 additions & 2 deletions mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func (mempool *Mempool) GetMemPoolParents(entry *TxMempoolEntry) *container.Set
return result.(*TxLinks).Parents
}

func (mempool *Mempool) GetMinFee(sizeLimit int64) utils.FeeRate {
func (mempool *Mempool) GetMinFee(sizeLimit int64) *utils.FeeRate {
mempool.Mtx.RLock()
defer mempool.Mtx.RUnlock()
if !mempool.BlockSinceLatRollingFeeBump || mempool.RollingMinimumFeeRate == 0 {
Expand Down Expand Up @@ -473,7 +473,7 @@ func (mempool *Mempool) GetMinFee(sizeLimit int64) utils.FeeRate {
return utils.NewFeeRate(result)
}

func (mempool *Mempool) TrackPackageRemoved(rate utils.FeeRate) {
func (mempool *Mempool) TrackPackageRemoved(rate *utils.FeeRate) {
if float64(rate.GetFeePerK()) > mempool.RollingMinimumFeeRate {
mempool.RollingMinimumFeeRate = float64(rate.GetFeePerK())
mempool.BlockSinceLatRollingFeeBump = false
Expand Down
4 changes: 2 additions & 2 deletions mempool/txentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ func NewTxentry(tx *core.Tx, txFee int64, acceptTime int64, height int, lp core.
return t
}

func (t *TxEntry) GetFeeRate() utils.FeeRate {
func (t *TxEntry) GetFeeRate() *utils.FeeRate {
return utils.NewFeeRateWithSize(t.TxFee, int64(t.TxSize))
}

func (t *TxEntry) GetInfo() *TxMempoolInfo {
return &TxMempoolInfo{
Tx: t.Tx,
Time: t.time,
FeeRate: t.GetFeeRate(),
FeeRate: *t.GetFeeRate(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions mempool/txmempool_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (txMempoolEntry *TxMempoolEntry) GetInfo() *TxMempoolInfo {
return &TxMempoolInfo{
Tx: txMempoolEntry.TxRef,
Time: txMempoolEntry.Time,
FeeRate: txMempoolEntry.GetFeeRate(),
FeeRate: *txMempoolEntry.GetFeeRate(),
FeeDelta: txMempoolEntry.FeeDelta,
}
}
Expand Down Expand Up @@ -96,7 +96,7 @@ func (txMempoolEntry *TxMempoolEntry) UpdateFeeDelta(newFeeDelta int64) {

}

func (txMempoolEntry *TxMempoolEntry) GetFeeRate() utils.FeeRate {
func (txMempoolEntry *TxMempoolEntry) GetFeeRate() *utils.FeeRate {
return utils.NewFeeRateWithSize(int64(txMempoolEntry.Fee), int64(txMempoolEntry.TxSize))
}

Expand Down
Loading

0 comments on commit e83852d

Please sign in to comment.