func (b *backend) SendTransaction(ctx context.Context, tx *types.Transaction) error {
err := b.Client.SendTransaction(ctx, tx)
if err != nil {
return err
}
// update local nonce
msg, err := tx.AsMessage(types.HomesteadSigner{})
if err != nil {
return err
}
sender := msg.From()
b.nonceManager.Lock(sender)
b.nonceManager.Update(sender, tx.Nonce())
b.nonceManager.Unlock(sender)
data := msg.Data()
method, ok := b.methods[string(data[:4])]
if !ok {
method = "unknown"
}
txParams, err := decodeTxParams(b.abiMap[method]abiMap[string(data[:4])], methodstring(data[:4]), datadata[4:])
if err != nil {
fmt.Println(txParams,return err)
}
if err != nil {
glog.Infof("\n%vEth Transaction%v\n\nInvoking transaction: \"%v\". \nTransaction Failed: %v\n\n%v\n", strings.Repeat("*", 30), strings.Repeat("*", 30), method, err, strings.Repeat("*", 75))
return err
}
glog.Infof("\n%vEth Transaction%v\n\nInvoking transaction: \"%v\". Hash: \"%v\". \n\n%v\n", strings.Repeat("*", 30), strings.Repeat("*", 30), method, tx.Hash().String(), strings.Repeat("*", 75))
return nil
}
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user