0

I'm using the wallet RPC method transfer to create transactions, with do_not_relay set to true. Sometimes I have to abandon this transaction (not submitting/committing it), but the outputs get marked as spent. I run into Known ring does not include the spent output errors.

Is there any way to set them back to unspent, so they can be used for future transfers?

1
  • Until you (attempt) to relay, nothing is done to the outputs (they are still spendable).
    – jtgrassie
    Jul 11, 2023 at 11:56

1 Answer 1

1

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
      }
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.