Update for untyped btcutil consts.
ok @davecgh
This commit is contained in:
parent
2afc5a0af2
commit
9e60210f18
3 changed files with 9 additions and 9 deletions
|
@ -28,7 +28,7 @@ const (
|
|||
|
||||
// minHighPriority is the minimum priority value that allows a
|
||||
// transaction to be considered high priority.
|
||||
minHighPriority = btcutil.SatoshiPerBitcoin * 144 / 250
|
||||
minHighPriority = btcutil.SatoshiPerBitcoin * 144.0 / 250
|
||||
|
||||
// blockHeaderOverhead is the max number of bytes it takes to serialize
|
||||
// a block header and max possible transaction count.
|
||||
|
@ -666,13 +666,13 @@ mempoolLoop:
|
|||
// the priority size or there are no more high-priority
|
||||
// transactions.
|
||||
if !sortedByFee && (blockPlusTxSize >= cfg.BlockPrioritySize ||
|
||||
prioItem.priority <= float64(minHighPriority)) {
|
||||
prioItem.priority <= minHighPriority) {
|
||||
|
||||
minrLog.Tracef("Switching to sort by fees per "+
|
||||
"kilobyte blockSize %d >= BlockPrioritySize "+
|
||||
"%d || priority %.2f <= minHighPriority %.2f",
|
||||
blockPlusTxSize, cfg.BlockPrioritySize,
|
||||
prioItem.priority, float64(minHighPriority))
|
||||
prioItem.priority, minHighPriority)
|
||||
|
||||
sortedByFee = true
|
||||
priorityQueue.SetLessFunc(txPQByFee)
|
||||
|
@ -684,7 +684,7 @@ mempoolLoop:
|
|||
// final one in the high-priority section, so just fall
|
||||
// though to the code below so it is added now.
|
||||
if blockPlusTxSize > cfg.BlockPrioritySize ||
|
||||
prioItem.priority < float64(minHighPriority) {
|
||||
prioItem.priority < minHighPriority {
|
||||
|
||||
heap.Push(priorityQueue, prioItem)
|
||||
continue
|
||||
|
|
|
@ -802,7 +802,7 @@ func createVoutList(mtx *btcwire.MsgTx, net *btcnet.Params) ([]btcjson.Vout, err
|
|||
voutList := make([]btcjson.Vout, len(mtx.TxOut))
|
||||
for i, v := range mtx.TxOut {
|
||||
voutList[i].N = uint32(i)
|
||||
voutList[i].Value = float64(v.Value) / float64(btcutil.SatoshiPerBitcoin)
|
||||
voutList[i].Value = float64(v.Value) / btcutil.SatoshiPerBitcoin
|
||||
|
||||
disbuf, err := btcscript.DisasmString(v.PkScript)
|
||||
if err != nil {
|
||||
|
@ -1265,7 +1265,7 @@ func handleGetInfo(s *rpcServer, cmd btcjson.Cmd, closeChan <-chan struct{}) (in
|
|||
Proxy: cfg.Proxy,
|
||||
Difficulty: getDifficultyRatio(blkHeader.Bits),
|
||||
TestNet: cfg.TestNet3,
|
||||
RelayFee: float64(minTxRelayFee) / float64(btcutil.SatoshiPerBitcoin),
|
||||
RelayFee: float64(minTxRelayFee) / btcutil.SatoshiPerBitcoin,
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
|
@ -1446,7 +1446,7 @@ func handleGetRawMempool(s *rpcServer, cmd btcjson.Cmd, closeChan <-chan struct{
|
|||
mpd := &btcjson.GetRawMempoolResult{
|
||||
Size: int32(desc.Tx.MsgTx().SerializeSize()),
|
||||
Fee: float64(desc.Fee) /
|
||||
float64(btcutil.SatoshiPerBitcoin),
|
||||
btcutil.SatoshiPerBitcoin,
|
||||
Time: desc.Added.Unix(),
|
||||
Height: desc.Height,
|
||||
StartingPriority: 0, // We don't mine.
|
||||
|
|
|
@ -129,7 +129,7 @@ func toSatoshi(val string) (interface{}, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return int64(float64(btcutil.SatoshiPerBitcoin) * idx), nil
|
||||
return int64(btcutil.SatoshiPerBitcoin * idx), nil
|
||||
}
|
||||
|
||||
// toInt attempts to convert the passed string to an integer. It returns the
|
||||
|
@ -720,7 +720,7 @@ func makeSendMany(args []interface{}) (btcjson.Cmd, error) {
|
|||
}
|
||||
pairs := make(map[string]int64)
|
||||
for addr, value := range origPairs {
|
||||
pairs[addr] = int64(float64(btcutil.SatoshiPerBitcoin) * value)
|
||||
pairs[addr] = int64(btcutil.SatoshiPerBitcoin * value)
|
||||
}
|
||||
|
||||
var optargs = make([]interface{}, 0, 2)
|
||||
|
|
Loading…
Reference in a new issue