monero-project / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
8.98k stars 3.11k forks source link

Can not send transaction Error: internal error: real output not found #8652

Open stanbar opened 1 year ago

stanbar commented 1 year ago

Hi, I'm trying to send a transaction using monero-wallet-cli connected to local stagenet.

I'm running local stage net two nodes (as suggested on stackoverflow)

monerod --version
Monero 'Fluorine Fermi' (v0.18.1.2-release)

monerod --stagenet --no-igd --hide-my-port --data-dir node1 --p2p-bind-ip 127.0.0.1 --p2p-bind-port 48080 --rpc-bind-port 48081 --zmq-rpc-bind-port 48082 --add-exclusive-node 127.0.0.1:38080

monerod --stagenet --no-igd --hide-my-port --data-dir node2 --p2p-bind-ip 127.0.0.1 --rpc-bind-ip 0.0.0.0 --confirm-external-bind --add-exclusive-node 127.0.0.1:48080

then connecting to them on two terminals with monero-wallet-cli --stagenet

After mining some XMR I try to send the transaction from the first one to the second one, but I get an error:

[wallet 5BKk1r]: version
Monero 'Fluorine Fermi' (v0.18.1.2-release)
[wallet 5BKk1r]: refresh
Starting refresh...
Refresh done, blocks received: 0
Currently selected account: [0] Primary account
Tag: (No tag assigned)
Balance: 69077.964019386086, unlocked balance: 68043.883242532499 (59 block(s) to unlock)
[wallet 5BKk1r]: transfer 571DVUhmatR9yJP9raWxK9WaZjd51hW2wUKy1hY3A1sVM7ifsWxbPYWetzXXeEG4ngVBSUuxkk1eQA3BMm5oAaubRKzHCpw 10
Wallet password:
Error: internal error: real output not found

I tried using two different machines, Arch linux x86 and MacBook Apple M1, both of them throw the same error.

ajordanBBN commented 1 year ago

I had the same problem. I think the problem is that the code to parse the arguments for the transfer command doesn't match the usage statement. You seem to have to provide a ring size, even though the usage statement indicates that it is an optional parameter:

https://github.com/monero-project/monero/blob/00fd416a99686f0956361d1cd0337fe56e58d4a7/src/simplewallet/simplewallet.cpp#L6273-L6290

Note that at line 6275, it only checks to see if you have more than zero arguments left, and if you do, it interprets the first argument as the ring size. This doesn't match the usage statement, and the error checking block for the call to get_xtype_from_string is, rather hilariously, empty.

I don't know how to fix the code, but I was able to get transactions to spend by putting a value in front of the address, so that the ring_size parameter gets a value. This worked:

transfer 16 REDACTED_ADDRESS REDACTED_AMOUNT

but this didn't:

transfer REDACTED_ADDRESS REDACTED AMOUNT