lockunspent

Back to wallet

Wallet

Summary

Updates list of temporarily unspendable outputs.

Description

Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending QBT. Manually selected coins are automatically unlocked. Locks are stored in memory only, unless persistent=true, in which case they will be written to the wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not. Also see the listunspent call

Arguments

  • unlock (BOOL, required): Whether to unlock (true) or lock (false) the specified transactions
  • transactions (ARR): The transaction outputs and within each, the txid (string) vout (numeric).
  • value (OBJ): No description.
    • txid (STR_HEX, required): The transaction id
    • vout (NUM, required): The output number
  • persistent (BOOL): Whether to write/erase this lock in the wallet database, or keep the change in memory only. Ignored for unlocking.

Results

  • value (BOOL): Whether the command was successful or not

Examples

List the unspent transactions
qbit-cli listunspent
Lock an unspent transaction
qbit-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
List the locked transactions
qbit-cli listlockunspent
Unlock the transaction again
qbit-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
Lock the transaction persistently in the wallet database
qbit-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]" true
As a JSON-RPC call
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"]}' -H 'content-type: application/json' http://127.0.0.1:8352/