Skip to content

Commit

Permalink
On estimateFee always assume that the recipient has ECDSA address
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Sep 18, 2024
1 parent decbcd8 commit 707b3a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmd/kaspawallet/daemon/server/create_unsigned_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (s *server) selectUTXOsWithPreselected(preSelectedUTXOs []*walletUTXO, allo
if isSendAll {
estimatedRecipientValue = totalValue
}

fee, err = s.estimateFee(selectedUTXOs, feeRate, maxFee, estimatedRecipientValue)
if err != nil {
return false, err
Expand Down Expand Up @@ -261,8 +261,8 @@ func (s *server) selectUTXOsWithPreselected(preSelectedUTXOs []*walletUTXO, allo
}

func (s *server) estimateFee(selectedUTXOs []*libkaspawallet.UTXO, feeRate float64, maxFee uint64, recipientValue uint64) (uint64, error) {
fakePubKey := [util.PublicKeySize]byte{}
fakeAddr, err := util.NewAddressPublicKey(fakePubKey[:], s.params.Prefix)
fakePubKey := [util.PublicKeySizeECDSA]byte{}
fakeAddr, err := util.NewAddressPublicKeyECDSA(fakePubKey[:], s.params.Prefix) // We assume the worst case where the recipient address is ECDSA. In this case the scriptPubKey will be the longest.
if err != nil {
return 0, 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 = "rc6"
var appBuild string = "rc7"

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

Expand Down

0 comments on commit 707b3a1

Please sign in to comment.