diff --git a/wallet/nockhash.go b/wallet/nockhash.go index db71001..d4fc0b8 100644 --- a/wallet/nockhash.go +++ b/wallet/nockhash.go @@ -146,11 +146,7 @@ func HashSource(source *nockchain.NockchainSource) [5]uint64 { return crypto.Tip5Zero } sourceHash := crypto.Base58ToTip5Hash(source.Source) - if source.IsCoinbase { - return crypto.Tip5RehashTenCell(sourceHash, crypto.Tip5One) - } else { - return crypto.Tip5RehashTenCell(sourceHash, crypto.Tip5Zero) - } + return crypto.Tip5RehashTenCell(sourceHash, crypto.Tip5One) } func HashSeedWithoutSource(seed *nockchain.NockchainSeed) ([5]uint64, error) { diff --git a/wallet/service.go b/wallet/service.go index 568c24a..a9132f1 100644 --- a/wallet/service.go +++ b/wallet/service.go @@ -472,7 +472,7 @@ func (h *GprcHandler) CreateTx(ctx context.Context, req *nockchain.CreateTxReque TxId: "", Inputs: inputs, TimelockRange: timelockRange, - TotalFees: req.Fee, + TotalFees: req.Fee * uint64(len(inputs)), } txId, err := ComputeTxId(inputs, timelockRange, req.Fee) if err != nil { diff --git a/wallet/types.go b/wallet/types.go index 258578f..21abf9a 100644 --- a/wallet/types.go +++ b/wallet/types.go @@ -67,7 +67,7 @@ func ParseBalanceEntry(entry *nockchain.BalanceEntry) nockchain.NockchainNote { }, Source: &nockchain.NockchainSource{ Source: crypto.Tip5HashToBase58(sourceHash), - IsCoinbase: true, + IsCoinbase: entry.Note.Source.Coinbase, }, Asset: entry.Note.Assets.Value, } @@ -113,12 +113,12 @@ func ConvertInput(input *nockchain.NockchainInput) (*nockchain.NamedInput, error for _, seed := range input.Spend.Seeds { seedPks := []*nockchain.SchnorrPubkey{} - for _, i := range input.Note.Lock.Pubkeys { + for _, i := range seed.Recipient.Pubkeys { pk, err := ParseSchnorrPubkey(i) if err != nil { return nil, err } - pks = append(seedPks, pk) + seedPks = append(seedPks, pk) } var source *nockchain.OutputSource if seed.OutputSource != nil {