but the outputs get marked as spent
The outputs do not get marked as spent until you commit (broadcast/relay/submit) the transaction.
Proof:
curl -sd '{"jsonrpc":"2.0","id":"0","method":"get_balance"}' http://localhost:28084/json_rpc
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"balance": 9093428812095,
"blocks_to_unlock": 0,
"multisig_import_needed": false,
"per_subaddress": [{
"account_index": 0,
"address": "9y4V...",
"address_index": 0,
"balance": 9093428812095,
"blocks_to_unlock": 0,
"label": "Primary account",
"num_unspent_outputs": 72,
"time_to_unlock": 0,
"unlocked_balance": 9093428812095
}],
"time_to_unlock": 0,
"unlocked_balance": 9093428812095
}
}
curl -sd '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"do_not_relay":true,"destinations":[{"address":"9xBu...","amount":1000000000000}]}' http://localhost:28084/json_rpc
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"amount": 1000000000000,
"fee": 61660000,
"multisig_txset": "",
"spent_key_images": {
"key_images": ["dbc9..."]
},
"tx_blob": "",
"tx_hash": "5094...",
"tx_key": "",
"tx_metadata": "",
"unsigned_txset": "",
"weight": 2202
}
}
curl -sd '{"jsonrpc":"2.0","id":"0","method":"get_balance"}' http://localhost:28084/json_rpc
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"balance": 9093428812095,
"blocks_to_unlock": 0,
"multisig_import_needed": false,
"per_subaddress": [{
"account_index": 0,
"address": "9y4V...",
"address_index": 0,
"balance": 9093428812095,
"blocks_to_unlock": 0,
"label": "Primary account",
"num_unspent_outputs": 72,
"time_to_unlock": 0,
"unlocked_balance": 9093428812095
}],
"time_to_unlock": 0,
"unlocked_balance": 9093428812095
}
}