fix: send tx
This commit is contained in:
parent
61e84ab801
commit
1f2db5b7e3
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user