Update for untyped btcutil consts.

ok @davecgh
This commit is contained in:
Josh Rickmar 2014-07-07 09:05:17 -05:00
parent 2afc5a0af2
commit 9e60210f18
3 changed files with 9 additions and 9 deletions

View file

@ -28,7 +28,7 @@ const (
// minHighPriority is the minimum priority value that allows a // minHighPriority is the minimum priority value that allows a
// transaction to be considered high priority. // 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 // blockHeaderOverhead is the max number of bytes it takes to serialize
// a block header and max possible transaction count. // a block header and max possible transaction count.
@ -666,13 +666,13 @@ mempoolLoop:
// the priority size or there are no more high-priority // the priority size or there are no more high-priority
// transactions. // transactions.
if !sortedByFee && (blockPlusTxSize >= cfg.BlockPrioritySize || if !sortedByFee && (blockPlusTxSize >= cfg.BlockPrioritySize ||
prioItem.priority <= float64(minHighPriority)) { prioItem.priority <= minHighPriority) {
minrLog.Tracef("Switching to sort by fees per "+ minrLog.Tracef("Switching to sort by fees per "+
"kilobyte blockSize %d >= BlockPrioritySize "+ "kilobyte blockSize %d >= BlockPrioritySize "+
"%d || priority %.2f <= minHighPriority %.2f", "%d || priority %.2f <= minHighPriority %.2f",
blockPlusTxSize, cfg.BlockPrioritySize, blockPlusTxSize, cfg.BlockPrioritySize,
prioItem.priority, float64(minHighPriority)) prioItem.priority, minHighPriority)
sortedByFee = true sortedByFee = true
priorityQueue.SetLessFunc(txPQByFee) priorityQueue.SetLessFunc(txPQByFee)
@ -684,7 +684,7 @@ mempoolLoop:
// final one in the high-priority section, so just fall // final one in the high-priority section, so just fall
// though to the code below so it is added now. // though to the code below so it is added now.
if blockPlusTxSize > cfg.BlockPrioritySize || if blockPlusTxSize > cfg.BlockPrioritySize ||
prioItem.priority < float64(minHighPriority) { prioItem.priority < minHighPriority {
heap.Push(priorityQueue, prioItem) heap.Push(priorityQueue, prioItem)
continue continue

View file

@ -802,7 +802,7 @@ func createVoutList(mtx *btcwire.MsgTx, net *btcnet.Params) ([]btcjson.Vout, err
voutList := make([]btcjson.Vout, len(mtx.TxOut)) voutList := make([]btcjson.Vout, len(mtx.TxOut))
for i, v := range mtx.TxOut { for i, v := range mtx.TxOut {
voutList[i].N = uint32(i) 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) disbuf, err := btcscript.DisasmString(v.PkScript)
if err != nil { if err != nil {
@ -1265,7 +1265,7 @@ func handleGetInfo(s *rpcServer, cmd btcjson.Cmd, closeChan <-chan struct{}) (in
Proxy: cfg.Proxy, Proxy: cfg.Proxy,
Difficulty: getDifficultyRatio(blkHeader.Bits), Difficulty: getDifficultyRatio(blkHeader.Bits),
TestNet: cfg.TestNet3, TestNet: cfg.TestNet3,
RelayFee: float64(minTxRelayFee) / float64(btcutil.SatoshiPerBitcoin), RelayFee: float64(minTxRelayFee) / btcutil.SatoshiPerBitcoin,
} }
return ret, nil return ret, nil
@ -1446,7 +1446,7 @@ func handleGetRawMempool(s *rpcServer, cmd btcjson.Cmd, closeChan <-chan struct{
mpd := &btcjson.GetRawMempoolResult{ mpd := &btcjson.GetRawMempoolResult{
Size: int32(desc.Tx.MsgTx().SerializeSize()), Size: int32(desc.Tx.MsgTx().SerializeSize()),
Fee: float64(desc.Fee) / Fee: float64(desc.Fee) /
float64(btcutil.SatoshiPerBitcoin), btcutil.SatoshiPerBitcoin,
Time: desc.Added.Unix(), Time: desc.Added.Unix(),
Height: desc.Height, Height: desc.Height,
StartingPriority: 0, // We don't mine. StartingPriority: 0, // We don't mine.

View file

@ -129,7 +129,7 @@ func toSatoshi(val string) (interface{}, error) {
if err != nil { if err != nil {
return nil, err 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 // 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) pairs := make(map[string]int64)
for addr, value := range origPairs { for addr, value := range origPairs {
pairs[addr] = int64(float64(btcutil.SatoshiPerBitcoin) * value) pairs[addr] = int64(btcutil.SatoshiPerBitcoin * value)
} }
var optargs = make([]interface{}, 0, 2) var optargs = make([]interface{}, 0, 2)