The sendrawtransaction handler at services/rpc/handlers.go:801 returns []*ResponseWrapper (an array) instead of the transaction ID as a string.
Current code
res, err := d.SendTransaction(context.Background(), tx)
if err != nil {
return nil, &bsvjson.RPCError{
Code: bsvjson.ErrRPCInvalidParameter,
Message: "TX rejected: " + err.Error(),
}
}
return res, nil // Returns []*ResponseWrapper
Expected
Per the handler documentation (line 754) and standard Bitcoin RPC behavior, it should return the transaction ID as a string.
Fix
Error received by clients
json: cannot unmarshal array into Go struct field Response[...].result of type string
Tested on v0.11.17
The
sendrawtransactionhandler atservices/rpc/handlers.go:801returns[]*ResponseWrapper(an array) instead of the transaction ID as a string.Current code
Expected
Per the handler documentation (line 754) and standard Bitcoin RPC behavior, it should return the transaction ID as a string.
Fix
Error received by clients
Tested on v0.11.17