testmempoolaccept
Summary
Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
Description
Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.
If multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other.
If one transaction fails, other transactions may not be fully validated (the 'allowed' key will be blank).
The maximum number of transactions allowed is 25.
This checks if transactions violate the consensus or policy rules.
See sendrawtransaction call.
Arguments
rawtxs(ARR, required): An array of hex strings of raw transactions.rawtx(STR_HEX): No description.maxfeerate(AMOUNT): Reject transactions whose fee rate is higher than the specified value, expressed in QBT/kvB. Fee rates larger than 1QBT/kvB are rejected. Set to 0 to accept any fee rate.
Results
-
value(ARR): The result of the mempool acceptance test for each raw transaction in the input array. Returns results for each transaction in the same order they were passed in. Transactions that cannot be fully validated due to failures in other transactions will not contain an 'allowed' result. -
value(OBJ): No description.txid(STR_HEX): The transaction hash in hexwtxid(STR_HEX): The transaction witness hash in hexpackage-error(STR, optional): Package validation error, if any (only possible if rawtxs had more than 1 transaction).allowed(BOOL, optional): Whether this tx would be accepted to the mempool and pass client-specified maxfeerate. If not present, the tx was not fully validated due to a failure in another tx in the list.vsize(NUM, optional): Sigops-adjusted virtual transaction size used for fee and policy checks; qbit does not discount witness data (only present when 'allowed' is true)fees(OBJ, optional): Transaction fees (only present if 'allowed' is true)base(STR_AMOUNT): transaction fee in QBTeffective-feerate(STR_AMOUNT): the effective feerate in QBT per KvB. May differ from the base feerate if, for example, there are modified fees from prioritisetransaction or a package feerate was used.effective-includes(ARR): transactions whose fees and vsizes are included in effective-feerate.value(STR_HEX): transaction wtxid in hex
reject-reason(STR, optional): Rejection reason (only present when 'allowed' is false)reject-details(STR, optional): Rejection details (only present when 'allowed' is false and rejection details exist)
Examples
Create a transaction
qbit-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}"
Sign the transaction, and get back the hex
qbit-cli signrawtransactionwithwallet "myhex"
Test acceptance of the transaction (signed hex)
qbit-cli testmempoolaccept '["signedhex"]'
As a JSON-RPC call
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "testmempoolaccept", "params": [["signedhex"]]}' -H 'content-type: application/json' http://127.0.0.1:8352/