fix: send tx

This commit is contained in:
Anh Minh 2025-10-09 11:06:46 +07:00
parent 61e84ab801
commit 1f2db5b7e3
3 changed files with 5 additions and 9 deletions

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {