jtgrassie / monero-pool

A Monero mining pool server written in C
BSD 3-Clause "New" or "Revised" License
353 stars 125 forks source link

monero-wallet-roc throws an exception when certain rpc requests get made from the pool but doesn't when sent via curl #126

Closed sne4ker closed 2 years ago

sne4ker commented 2 years ago

First of all thank you for your work.

I'm currently setting up the pool software, running monero-wallet-rpc with the following command:

monero-wallet-rpc --config-file /path/to/config.conf This is my config file:

daemon-address=127.0.0.1:18081
rpc-bind-port=18085
rpc-bind-ip=127.0.0.1
wallet-file=/path/to/wallet
password=<redacted>
log-level=0
log-file=/var/log/mwrpc.log
disable-rpc-login=1

After a while I get the following error in the session running monero-wallet-rpc:

2022-08-03 02:59:47.804E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2022-08-03 02:59:47.804E Exception at while refreshing, what=no connection to daemon

I looked at netstat - napt which showed the connection as ESTABLISHED. I then monitored the traffic with tshark in another window and saw that the connection error occurs at the point a JSON rpc request gets made. But when I send a request via curl, i.e. get_height:

curl http://127.0.0.1:18085/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_height"}' -H 'Content-Type: application/json'

I get the correct output of the current height, which means it has to have a connection to the daemon:

{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "height": 2681215
  }

Can I ignore the errors that are thrown, as there are no errors in the pool logs I see while the error occurs in monero-wallet-rpc and it looks like the pool gets the correct values from the rpc request?

jtgrassie commented 2 years ago

The error/exception is coming from the monero-wallet-rpc, not the pool. If you want to report an issue with the monero-wallet-rpc then you need to do so on that repository.

sne4ker commented 2 years ago

I have actually already created one: https://github.com/monero-project/monero/issues/8477

Is there any way I can check if the pool withdrawals work correctly, as that is my main concern? Can I manually set the current due balance of a user so I can try withdrawing XMR?

jtgrassie commented 2 years ago

Just mine to testnet if you're worried.