Skip to content

Commit

Permalink
Fix calculateFeeLimits nil handling
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Sep 16, 2024
1 parent 2b1d3a1 commit 8e8f7c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cmd/kaspawallet/daemon/server/create_unsigned_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
feeRate = minFeeRate
maxFee = math.MaxUint64

if requestFeePolicy == nil {
requestFeePolicy = &pb.FeePolicy{}
}

switch requestFeePolicy := requestFeePolicy.FeePolicy.(type) {
case *pb.FeePolicy_ExactFeeRate:
feeRate = requestFeePolicy.ExactFeeRate
Expand Down
2 changes: 1 addition & 1 deletion cmd/kaspawallet/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func parse(conf *parseConfig) error {
fmt.Println()

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)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
// 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.
// It MUST only contain characters from validCharacters.
var appBuild string = "rc3"
var appBuild string = "rc5"

var version = "" // string used for memoization of version

Expand Down

0 comments on commit 8e8f7c9

Please sign in to comment.