Open 8lecramm opened 2 years ago
The second commit fixes an issue when trying to create a TX with more than 1 integrated address. See issue #92 This function will return in any case.
if addr.IsIntegratedAddress() && len(transfers[t].Payload_RPC) == 0 {
for _, arg := range addr.Arguments {
if arg.Name == rpc.RPC_DESTINATION_PORT && addr.Arguments.Has(rpc.RPC_DESTINATION_PORT, rpc.DataUint64) {
transfers[t].Payload_RPC = append(transfers[t].Payload_RPC, rpc.Argument{Name: rpc.RPC_DESTINATION_PORT, DataType: rpc.DataUint64, Value: addr.Arguments.Value(rpc.RPC_DESTINATION_PORT, rpc.DataUint64).(uint64)})
continue
} else {
fmt.Printf("integrtated address, but don't know how to process\n")
err = fmt.Errorf("integrated address used, but don't know how to process %+v", addr.Arguments)
}
}
return <---- at wrong place
}
The calling function tries to create the TX twice before throwing an error. The first TX with an integrated address goes through, but crashes at the second one.
The 3rd commit shows the raw TX data when registration fails. The data can be used to register the wallet via DERO.SendRawTransaction RPC call.
Under certain conditions, the node throws a panic message when initiating a RPC call with an orphaned transaction.