mempool,rpc: add removetx rpc method (#7047)

Addresses one of the concerns with #7041.

Provides a mechanism (via the RPC interface) to delete a single transaction, described by its hash, from the mempool. The method returns an error if the transaction cannot be found. Once the transaction is removed it remains in the cache and cannot be resubmitted until the cache is cleared or it expires from the cache.
This commit is contained in:
Sam Kleinman
2021-10-05 20:23:15 +00:00
committed by GitHub
parent 3ea81bfaa7
commit 851d2e3bde
24 changed files with 137 additions and 78 deletions
+25
View File
@@ -237,6 +237,31 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/remove_tx:
get:
summary: Removes a transaction from the mempool.
tags:
- TxKey
operationId: remove_tx
parameters:
- in: query
name: txKey
required: true
schema:
type: string
example: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
description: The transaction key
responses:
"200":
description: empty response.
"500":
description: empty error.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/subscribe:
get:
summary: Subscribe for events via WebSocket.