Language

Choose a language

/build/rpc / btc

gettxspendingprevout

gettxspendingprevout [{"txid":"hex","vout":n},...] Scans the mempool to find transactions spending any of the given outputs Arguments: 1. outputs (json array, required) The transaction outputs that we want to check, and within each, the txid (string) vout (numeric). [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number }, ... ] Result: [ (json array) { (json object) "txid" : "hex", (string) the transaction id of the checked output "vout" : n, (numeric) the vout value of the checked output "spendingtxid" : "hex" (string, optional) the transaction id of the mempool transaction spending this output (omitted if unspent) }, ... ] Examples: > bitcoin-cli gettxspendingprevout "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":3}]" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "gettxspendingprevout", "params": ["[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":3}]"]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

gettxspendingprevout(outputs: array) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"gettxspendingprevout","params":[[]]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
outputsany[]yesThe transaction outputs that we want to check, and within each, the txid (string) vout (numeric). [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number }, ... ]

Result

Type:  any

[ (json array) { (json object) "txid" : "hex", (string) the transaction id of the checked output "vout" : n, (numeric) the vout value of the checked output "spendingtxid" : "hex" (string, optional) the transaction id of the mempool transaction spending this output (omitted if unspent) }, ... ]

Source: services/core-node/bcore/src/rpc/mempool.cpp:590

C++ symbol: gettxspendingprevout