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 16:23:15 -04:00
committed by GitHub
parent 3ea81bfaa7
commit 851d2e3bde
24 changed files with 137 additions and 78 deletions

View File

@@ -212,6 +212,10 @@ func (c *Client) CheckTx(ctx context.Context, tx types.Tx) (*coretypes.ResultChe
return c.next.CheckTx(ctx, tx)
}
func (c *Client) RemoveTx(ctx context.Context, txKey types.TxKey) error {
return c.next.RemoveTx(ctx, txKey)
}
func (c *Client) NetInfo(ctx context.Context) (*coretypes.ResultNetInfo, error) {
return c.next.NetInfo(ctx)
}