mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-07-05 04:12:30 +00:00
Fix calculateFeeLimits nil handling
This commit is contained in:
parent
2b1d3a1a04
commit
8e8f7c9b32
@ -43,6 +43,11 @@ func (s *server) CreateUnsignedTransactions(_ context.Context, request *pb.Creat
|
|||||||
func (s *server) calculateFeeLimits(requestFeePolicy *pb.FeePolicy) (feeRate float64, maxFee uint64, err error) {
|
func (s *server) calculateFeeLimits(requestFeePolicy *pb.FeePolicy) (feeRate float64, maxFee uint64, err error) {
|
||||||
feeRate = minFeeRate
|
feeRate = minFeeRate
|
||||||
maxFee = math.MaxUint64
|
maxFee = math.MaxUint64
|
||||||
|
|
||||||
|
if requestFeePolicy == nil {
|
||||||
|
requestFeePolicy = &pb.FeePolicy{}
|
||||||
|
}
|
||||||
|
|
||||||
switch requestFeePolicy := requestFeePolicy.FeePolicy.(type) {
|
switch requestFeePolicy := requestFeePolicy.FeePolicy.(type) {
|
||||||
case *pb.FeePolicy_ExactFeeRate:
|
case *pb.FeePolicy_ExactFeeRate:
|
||||||
feeRate = requestFeePolicy.ExactFeeRate
|
feeRate = requestFeePolicy.ExactFeeRate
|
||||||
|
@ -90,7 +90,7 @@ func parse(conf *parseConfig) error {
|
|||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
||||||
fee := allInputSompi - allOutputSompi
|
fee := allInputSompi - allOutputSompi
|
||||||
fmt.Printf("Fee:\t%d Sompi\n\n", fee)
|
fmt.Printf("Fee:\t%d Sompi (%f KAS)\n\n", fee, float64(fee)/float64(constants.SompiPerKaspa))
|
||||||
mass, err := server.EstimateMassAfterSignatures(partiallySignedTransaction, keysFile.ECDSA, keysFile.MinimumSignatures, txMassCalculator)
|
mass, err := server.EstimateMassAfterSignatures(partiallySignedTransaction, keysFile.ECDSA, keysFile.MinimumSignatures, txMassCalculator)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -17,7 +17,7 @@ const (
|
|||||||
// appBuild is defined as a variable so it can be overridden during the build
|
// appBuild is defined as a variable so it can be overridden during the build
|
||||||
// process with '-ldflags "-X github.com/kaspanet/kaspad/version.appBuild=foo"' if needed.
|
// process with '-ldflags "-X github.com/kaspanet/kaspad/version.appBuild=foo"' if needed.
|
||||||
// It MUST only contain characters from validCharacters.
|
// It MUST only contain characters from validCharacters.
|
||||||
var appBuild string = "rc3"
|
var appBuild string = "rc5"
|
||||||
|
|
||||||
var version = "" // string used for memoization of version
|
var version = "" // string used for memoization of version
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user