Disable bcash unsupported EstimateSmartFee
This commit is contained in:
parent
1540dc940d
commit
3f7ac68865
@ -5,7 +5,6 @@ import (
|
|||||||
"blockbook/bchain/coins/btc"
|
"blockbook/bchain/coins/btc"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"math/big"
|
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"github.com/juju/errors"
|
"github.com/juju/errors"
|
||||||
@ -158,30 +157,6 @@ func (b *BCashRPC) GetBlockFull(hash string) (*bchain.Block, error) {
|
|||||||
return nil, errors.New("Not implemented")
|
return nil, errors.New("Not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
// EstimateSmartFee returns fee estimation.
|
|
||||||
func (b *BCashRPC) EstimateSmartFee(blocks int, conservative bool) (big.Int, error) {
|
|
||||||
glog.V(1).Info("rpc: estimatesmartfee ", blocks)
|
|
||||||
|
|
||||||
res := btc.ResEstimateSmartFee{}
|
|
||||||
req := cmdEstimateSmartFee{Method: "estimatesmartfee"}
|
|
||||||
req.Params.Blocks = blocks
|
|
||||||
// conservative param is omitted
|
|
||||||
err := b.Call(&req, &res)
|
|
||||||
|
|
||||||
var r big.Int
|
|
||||||
if err != nil {
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
if res.Error != nil {
|
|
||||||
return r, res.Error
|
|
||||||
}
|
|
||||||
r, err = b.Parser.AmountToBigInt(res.Result.Feerate)
|
|
||||||
if err != nil {
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
return r, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func isErrBlockNotFound(err *bchain.RPCError) bool {
|
func isErrBlockNotFound(err *bchain.RPCError) bool {
|
||||||
return err.Message == "Block not found" ||
|
return err.Message == "Block not found" ||
|
||||||
err.Message == "Block height out of range"
|
err.Message == "Block height out of range"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user