mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-20 13:54:36 +01:00
lightningd: remove delexpiredinvoice
Changelog-Removed: JSON-RPC: `delexpiredinvoice` (deprecated v22.11, EOL v24.02) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
57e594762e
commit
7e0e39460b
23 changed files with 364 additions and 733 deletions
8
cln-grpc/proto/node.proto
generated
8
cln-grpc/proto/node.proto
generated
|
@ -23,7 +23,6 @@ service Node {
|
|||
rpc DatastoreUsage(DatastoreusageRequest) returns (DatastoreusageResponse) {}
|
||||
rpc CreateOnion(CreateonionRequest) returns (CreateonionResponse) {}
|
||||
rpc DelDatastore(DeldatastoreRequest) returns (DeldatastoreResponse) {}
|
||||
rpc DelExpiredInvoice(DelexpiredinvoiceRequest) returns (DelexpiredinvoiceResponse) {}
|
||||
rpc DelInvoice(DelinvoiceRequest) returns (DelinvoiceResponse) {}
|
||||
rpc Invoice(InvoiceRequest) returns (InvoiceResponse) {}
|
||||
rpc ListDatastore(ListdatastoreRequest) returns (ListdatastoreResponse) {}
|
||||
|
@ -593,13 +592,6 @@ message DeldatastoreResponse {
|
|||
optional string string = 4;
|
||||
}
|
||||
|
||||
message DelexpiredinvoiceRequest {
|
||||
optional uint64 maxexpirytime = 1;
|
||||
}
|
||||
|
||||
message DelexpiredinvoiceResponse {
|
||||
}
|
||||
|
||||
message DelinvoiceRequest {
|
||||
// DelInvoice.status
|
||||
enum DelinvoiceStatus {
|
||||
|
|
26
cln-grpc/src/convert.rs
generated
26
cln-grpc/src/convert.rs
generated
|
@ -502,14 +502,6 @@ impl From<responses::DeldatastoreResponse> for pb::DeldatastoreResponse {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::DelexpiredinvoiceResponse> for pb::DelexpiredinvoiceResponse {
|
||||
fn from(c: responses::DelexpiredinvoiceResponse) -> Self {
|
||||
Self {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::DelinvoiceResponse> for pb::DelinvoiceResponse {
|
||||
fn from(c: responses::DelinvoiceResponse) -> Self {
|
||||
|
@ -2082,15 +2074,6 @@ impl From<requests::DeldatastoreRequest> for pb::DeldatastoreRequest {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::DelexpiredinvoiceRequest> for pb::DelexpiredinvoiceRequest {
|
||||
fn from(c: requests::DelexpiredinvoiceRequest) -> Self {
|
||||
Self {
|
||||
maxexpirytime: c.maxexpirytime, // Rule #2 for type u64?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::DelinvoiceRequest> for pb::DelinvoiceRequest {
|
||||
fn from(c: requests::DelinvoiceRequest) -> Self {
|
||||
|
@ -2878,15 +2861,6 @@ impl From<pb::DeldatastoreRequest> for requests::DeldatastoreRequest {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::DelexpiredinvoiceRequest> for requests::DelexpiredinvoiceRequest {
|
||||
fn from(c: pb::DelexpiredinvoiceRequest) -> Self {
|
||||
Self {
|
||||
maxexpirytime: c.maxexpirytime, // Rule #1 for type u64?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::DelinvoiceRequest> for requests::DelinvoiceRequest {
|
||||
fn from(c: pb::DelinvoiceRequest) -> Self {
|
||||
|
|
|
@ -506,38 +506,6 @@ async fn del_datastore(
|
|||
|
||||
}
|
||||
|
||||
async fn del_expired_invoice(
|
||||
&self,
|
||||
request: tonic::Request<pb::DelexpiredinvoiceRequest>,
|
||||
) -> Result<tonic::Response<pb::DelexpiredinvoiceResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::DelexpiredinvoiceRequest = req.into();
|
||||
debug!("Client asked for del_expired_invoice");
|
||||
trace!("del_expired_invoice request: {:?}", req);
|
||||
let mut rpc = ClnRpc::new(&self.rpc_path)
|
||||
.await
|
||||
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
|
||||
let result = rpc.call(Request::DelExpiredInvoice(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method DelExpiredInvoice: {:?}", e)))?;
|
||||
match result {
|
||||
Response::DelExpiredInvoice(r) => {
|
||||
trace!("del_expired_invoice response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call DelExpiredInvoice",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn del_invoice(
|
||||
&self,
|
||||
request: tonic::Request<pb::DelinvoiceRequest>,
|
||||
|
|
40
cln-rpc/src/model.rs
generated
40
cln-rpc/src/model.rs
generated
|
@ -32,7 +32,6 @@ pub enum Request {
|
|||
DatastoreUsage(requests::DatastoreusageRequest),
|
||||
CreateOnion(requests::CreateonionRequest),
|
||||
DelDatastore(requests::DeldatastoreRequest),
|
||||
DelExpiredInvoice(requests::DelexpiredinvoiceRequest),
|
||||
DelInvoice(requests::DelinvoiceRequest),
|
||||
Invoice(requests::InvoiceRequest),
|
||||
ListDatastore(requests::ListdatastoreRequest),
|
||||
|
@ -102,7 +101,6 @@ pub enum Response {
|
|||
DatastoreUsage(responses::DatastoreusageResponse),
|
||||
CreateOnion(responses::CreateonionResponse),
|
||||
DelDatastore(responses::DeldatastoreResponse),
|
||||
DelExpiredInvoice(responses::DelexpiredinvoiceResponse),
|
||||
DelInvoice(responses::DelinvoiceResponse),
|
||||
Invoice(responses::InvoiceResponse),
|
||||
ListDatastore(responses::ListdatastoreResponse),
|
||||
|
@ -663,29 +661,6 @@ pub mod requests {
|
|||
"deldatastore"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct DelexpiredinvoiceRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maxexpirytime: Option<u64>,
|
||||
}
|
||||
|
||||
impl From<DelexpiredinvoiceRequest> for Request {
|
||||
fn from(r: DelexpiredinvoiceRequest) -> Self {
|
||||
Request::DelExpiredInvoice(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for DelexpiredinvoiceRequest {
|
||||
type Response = super::responses::DelexpiredinvoiceResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for DelexpiredinvoiceRequest {
|
||||
type Response = super::responses::DelexpiredinvoiceResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"delexpiredinvoice"
|
||||
}
|
||||
}
|
||||
/// ['Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!']
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub enum DelinvoiceStatus {
|
||||
|
@ -3487,21 +3462,6 @@ pub mod responses {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct DelexpiredinvoiceResponse {
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for DelexpiredinvoiceResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::DelExpiredInvoice(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// ['State of invoice.']
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub enum DelinvoiceStatus {
|
||||
|
|
|
@ -7932,53 +7932,6 @@
|
|||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
},
|
||||
"lightning-delexpiredinvoice.json": {
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delexpiredinvoice",
|
||||
"title": "Command for removing expired invoices",
|
||||
"description": [
|
||||
"The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"maxexpirytime": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Invoice expiry time in seconds. If not specified then all expired invoices are deleted."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delexpiredinvoice#1",
|
||||
"method": "delexpiredinvoice",
|
||||
"params": {
|
||||
"maxexpirytime": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
},
|
||||
"lightning-delforward.json": {
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
|
@ -8396,7 +8349,6 @@
|
|||
"lightning-listinvoice(7)",
|
||||
"lightning-waitinvoice(7)",
|
||||
"lightning-invoice(7)",
|
||||
"lightning-delexpiredinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
|
|
|
@ -73,7 +73,6 @@ def load_jsonrpc_service():
|
|||
"DatastoreUsage",
|
||||
"CreateOnion",
|
||||
"DelDatastore",
|
||||
"DelExpiredInvoice",
|
||||
"DelInvoice",
|
||||
"Invoice",
|
||||
"ListDatastore",
|
||||
|
|
|
@ -607,15 +607,6 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||
}
|
||||
return self.call("deldatastore", payload)
|
||||
|
||||
def delexpiredinvoice(self, maxexpirytime=None):
|
||||
"""
|
||||
Delete all invoices that have expired on or before the given {maxexpirytime}.
|
||||
"""
|
||||
payload = {
|
||||
"maxexpirytime": maxexpirytime
|
||||
}
|
||||
return self.call("delexpiredinvoice", payload)
|
||||
|
||||
def delinvoice(self, label, status, desconly=None):
|
||||
"""
|
||||
Delete unpaid invoice {label} with {status} (or, with {desconly} true, remove its description).
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -89,11 +89,6 @@ class NodeStub(object):
|
|||
request_serializer=node__pb2.DeldatastoreRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.DeldatastoreResponse.FromString,
|
||||
)
|
||||
self.DelExpiredInvoice = channel.unary_unary(
|
||||
'/cln.Node/DelExpiredInvoice',
|
||||
request_serializer=node__pb2.DelexpiredinvoiceRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.DelexpiredinvoiceResponse.FromString,
|
||||
)
|
||||
self.DelInvoice = channel.unary_unary(
|
||||
'/cln.Node/DelInvoice',
|
||||
request_serializer=node__pb2.DelinvoiceRequest.SerializeToString,
|
||||
|
@ -429,12 +424,6 @@ class NodeServicer(object):
|
|||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def DelExpiredInvoice(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def DelInvoice(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
|
@ -801,11 +790,6 @@ def add_NodeServicer_to_server(servicer, server):
|
|||
request_deserializer=node__pb2.DeldatastoreRequest.FromString,
|
||||
response_serializer=node__pb2.DeldatastoreResponse.SerializeToString,
|
||||
),
|
||||
'DelExpiredInvoice': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.DelExpiredInvoice,
|
||||
request_deserializer=node__pb2.DelexpiredinvoiceRequest.FromString,
|
||||
response_serializer=node__pb2.DelexpiredinvoiceResponse.SerializeToString,
|
||||
),
|
||||
'DelInvoice': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.DelInvoice,
|
||||
request_deserializer=node__pb2.DelinvoiceRequest.FromString,
|
||||
|
@ -1311,23 +1295,6 @@ class Node(object):
|
|||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def DelExpiredInvoice(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/cln.Node/DelExpiredInvoice',
|
||||
node__pb2.DelexpiredinvoiceRequest.SerializeToString,
|
||||
node__pb2.DelexpiredinvoiceResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def DelInvoice(request,
|
||||
target,
|
||||
|
|
|
@ -389,11 +389,6 @@ def deldatastore2py(m):
|
|||
})
|
||||
|
||||
|
||||
def delexpiredinvoice2py(m):
|
||||
return remove_default({
|
||||
})
|
||||
|
||||
|
||||
def delinvoice2py(m):
|
||||
return remove_default({
|
||||
"label": m.label, # PrimitiveField in generate_composite
|
||||
|
|
|
@ -33,7 +33,6 @@ GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
|
|||
doc/lightning-decode.7 \
|
||||
doc/lightning-decodepay.7 \
|
||||
doc/lightning-deldatastore.7 \
|
||||
doc/lightning-delexpiredinvoice.7 \
|
||||
doc/lightning-delforward.7 \
|
||||
doc/lightning-delinvoice.7 \
|
||||
doc/lightning-delpay.7 \
|
||||
|
@ -112,7 +111,7 @@ GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
|
|||
doc/lightning-splice_init.7 \
|
||||
doc/lightning-splice_signed.7 \
|
||||
doc/lightning-splice_update.7 \
|
||||
doc/lightning-staticbackup.7 \
|
||||
doc/lightning-staticbackup.7 \
|
||||
doc/lightning-stop.7 \
|
||||
doc/lightning-txdiscard.7 \
|
||||
doc/lightning-txprepare.7 \
|
||||
|
|
|
@ -7,8 +7,6 @@ hidden: false
|
|||
|
||||
| Name | Type | First Deprecated | Last Supported | Description |
|
||||
|--------------------------------------|--------------------|------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| delexpiredinvoice | Command | v22.11 | v24.02 | `autoclean-once` is more powerful |
|
||||
| autocleaninvoice | Command | v22.11 | v24.02 | `autoclean` is more general, does more than expired invoices |
|
||||
| autocleaninvoice-cycle | Config | v22.11 | v24.02 | Now always once per hour: you can run `autoclean-once` regularly if you need. |
|
||||
| autocleaninvoice-expired-by | Config | v22.11 | v24.02 | `autoclean`'s `autoclean-expiredinvoices-age` |
|
||||
| feerates.delayed_to_us | Field | v23.05 | v24.02 | Not used with anchor outputs. |
|
||||
|
|
|
@ -42,7 +42,6 @@ Core Lightning Documentation
|
|||
lightning-decode <lightning-decode.7.md>
|
||||
lightning-decodepay <lightning-decodepay.7.md>
|
||||
lightning-deldatastore <lightning-deldatastore.7.md>
|
||||
lightning-delexpiredinvoice <lightning-delexpiredinvoice.7.md>
|
||||
lightning-delforward <lightning-delforward.7.md>
|
||||
lightning-delinvoice <lightning-delinvoice.7.md>
|
||||
lightning-delpay <lightning-delpay.7.md>
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"$schema": "../rpc-schema-draft.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"rpc": "delexpiredinvoice",
|
||||
"title": "Command for removing expired invoices",
|
||||
"description": [
|
||||
"The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*."
|
||||
],
|
||||
"request": {
|
||||
"required": [],
|
||||
"properties": {
|
||||
"maxexpirytime": {
|
||||
"type": "u64",
|
||||
"description": [
|
||||
"Invoice expiry time in seconds. If not specified then all expired invoices are deleted."
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"required": [],
|
||||
"properties": {}
|
||||
},
|
||||
"example_json_request": [
|
||||
{
|
||||
"id": "example:delexpiredinvoice#1",
|
||||
"method": "delexpiredinvoice",
|
||||
"params": {
|
||||
"maxexpirytime": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"example_json_response": [
|
||||
{}
|
||||
],
|
||||
"author": [
|
||||
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
|
||||
],
|
||||
"see_also": [
|
||||
"lightning-delinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
]
|
||||
}
|
|
@ -329,7 +329,6 @@
|
|||
"lightning-listinvoice(7)",
|
||||
"lightning-waitinvoice(7)",
|
||||
"lightning-invoice(7)",
|
||||
"lightning-delexpiredinvoice(7)",
|
||||
"lightning-autoclean-status(7)"
|
||||
],
|
||||
"resources": [
|
||||
|
|
|
@ -1468,33 +1468,6 @@ static const struct json_command delinvoice_command = {
|
|||
};
|
||||
AUTODATA(json_command, &delinvoice_command);
|
||||
|
||||
static struct command_result *json_delexpiredinvoice(struct command *cmd,
|
||||
const char *buffer,
|
||||
const jsmntok_t *obj UNNEEDED,
|
||||
const jsmntok_t *params)
|
||||
{
|
||||
u64 *maxexpirytime;
|
||||
|
||||
if (!param(cmd, buffer, params,
|
||||
p_opt_def("maxexpirytime", param_u64, &maxexpirytime,
|
||||
time_now().ts.tv_sec),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
invoices_delete_expired(cmd->ld->wallet->invoices, *maxexpirytime);
|
||||
|
||||
return command_success(cmd, json_stream_success(cmd));
|
||||
}
|
||||
static const struct json_command delexpiredinvoice_command = {
|
||||
"delexpiredinvoice",
|
||||
"payment",
|
||||
json_delexpiredinvoice,
|
||||
"Delete all expired invoices that expired as of given {maxexpirytime} (a UNIX epoch time), or all expired invoices if not specified",
|
||||
.depr_start = "v22.11",
|
||||
.depr_end = "v24.02",
|
||||
};
|
||||
AUTODATA(json_command, &delexpiredinvoice_command);
|
||||
|
||||
static struct command_result *json_waitanyinvoice(struct command *cmd,
|
||||
const char *buffer,
|
||||
const jsmntok_t *obj UNNEEDED,
|
||||
|
|
|
@ -404,10 +404,6 @@ bool invoices_delete_description(struct invoices *invoices UNNEEDED,
|
|||
const struct json_escape *label UNNEEDED,
|
||||
const char *description UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_delete_description called!\n"); abort(); }
|
||||
/* Generated stub for invoices_delete_expired */
|
||||
void invoices_delete_expired(struct invoices *invoices UNNEEDED,
|
||||
u64 max_expiry_time UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_delete_expired called!\n"); abort(); }
|
||||
/* Generated stub for invoices_find_by_fallback_script */
|
||||
bool invoices_find_by_fallback_script(struct invoices *invoices UNNEEDED,
|
||||
u64 *inv_dbid UNNEEDED,
|
||||
|
@ -675,16 +671,6 @@ struct jsonrpc_request *jsonrpc_request_start_(
|
|||
void kill_uncommitted_channel(struct uncommitted_channel *uc UNNEEDED,
|
||||
const char *why UNNEEDED)
|
||||
{ fprintf(stderr, "kill_uncommitted_channel called!\n"); abort(); }
|
||||
/* Generated stub for lightningd_deprecated_in_ok */
|
||||
bool lightningd_deprecated_in_ok(struct lightningd *ld UNNEEDED,
|
||||
struct logger *log UNNEEDED,
|
||||
bool deprecated_apis UNNEEDED,
|
||||
const char *subsys UNNEEDED,
|
||||
const char *api UNNEEDED,
|
||||
const char *start UNNEEDED,
|
||||
const char *end UNNEEDED,
|
||||
const char *details UNNEEDED)
|
||||
{ fprintf(stderr, "lightningd_deprecated_in_ok called!\n"); abort(); }
|
||||
/* Generated stub for lightningd_deprecated_out_ok */
|
||||
bool lightningd_deprecated_out_ok(struct lightningd *ld UNNEEDED,
|
||||
bool deprecated_apis UNNEEDED,
|
||||
|
|
|
@ -19,21 +19,12 @@ s64 db_get_intvar(struct db *db UNNEEDED, const char *varname UNNEEDED, s64 defv
|
|||
/* Generated stub for db_set_readonly */
|
||||
void db_set_readonly(struct db *db UNNEEDED, bool readonly UNNEEDED)
|
||||
{ fprintf(stderr, "db_set_readonly called!\n"); abort(); }
|
||||
/* Generated stub for delayed_to_us_feerate */
|
||||
u32 delayed_to_us_feerate(struct chain_topology *topo UNNEEDED)
|
||||
{ fprintf(stderr, "delayed_to_us_feerate called!\n"); abort(); }
|
||||
/* Generated stub for fatal */
|
||||
void fatal(const char *fmt UNNEEDED, ...)
|
||||
{ fprintf(stderr, "fatal called!\n"); abort(); }
|
||||
/* Generated stub for feerate_for_deadline */
|
||||
u32 feerate_for_deadline(const struct chain_topology *topo UNNEEDED, u32 blockcount UNNEEDED)
|
||||
{ fprintf(stderr, "feerate_for_deadline called!\n"); abort(); }
|
||||
/* Generated stub for feerate_max */
|
||||
u32 feerate_max(struct lightningd *ld UNNEEDED, bool *unknown UNNEEDED)
|
||||
{ fprintf(stderr, "feerate_max called!\n"); abort(); }
|
||||
/* Generated stub for feerate_min */
|
||||
u32 feerate_min(struct lightningd *ld UNNEEDED, bool *unknown UNNEEDED)
|
||||
{ fprintf(stderr, "feerate_min called!\n"); abort(); }
|
||||
/* Generated stub for fromwire_bigsize */
|
||||
bigsize_t fromwire_bigsize(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||
{ fprintf(stderr, "fromwire_bigsize called!\n"); abort(); }
|
||||
|
@ -52,9 +43,6 @@ char *hsm_secret_arg(const tal_t *ctx UNNEEDED,
|
|||
const char *arg UNNEEDED,
|
||||
const u8 **hsm_secret UNNEEDED)
|
||||
{ fprintf(stderr, "hsm_secret_arg called!\n"); abort(); }
|
||||
/* Generated stub for htlc_resolution_feerate */
|
||||
u32 htlc_resolution_feerate(struct chain_topology *topo UNNEEDED)
|
||||
{ fprintf(stderr, "htlc_resolution_feerate called!\n"); abort(); }
|
||||
/* Generated stub for json_to_jsonrpc_errcode */
|
||||
bool json_to_jsonrpc_errcode(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
||||
enum jsonrpc_errcode *errcode UNNEEDED)
|
||||
|
|
|
@ -83,7 +83,6 @@ nav:
|
|||
- "lightning-decode": "lightning-decode.7.md"
|
||||
- "lightning-decodepay": "lightning-decodepay.7.md"
|
||||
- "lightning-deldatastore": "lightning-deldatastore.7.md"
|
||||
- "lightning-delexpiredinvoice": "lightning-delexpiredinvoice.7.md"
|
||||
- "lightning-delforward": "lightning-delforward.7.md"
|
||||
- "lightning-delinvoice": "lightning-delinvoice.7.md"
|
||||
- "lightning-delpay": "lightning-delpay.7.md"
|
||||
|
|
|
@ -706,8 +706,7 @@ def test_listinvoices_filter(node_factory):
|
|||
|
||||
|
||||
def test_wait_invoices(node_factory, executor):
|
||||
# We use delexpiredinvoice, and CLN complains!
|
||||
l1, l2 = node_factory.line_graph(2, opts={'i-promise-to-fix-broken-api-user': 'delexpiredinvoice'})
|
||||
l1, l2 = node_factory.line_graph(2)
|
||||
|
||||
# Asking for 0 gives us current index.
|
||||
waitres = l2.rpc.call('wait', {'subsystem': 'invoices', 'indexname': 'created', 'nextvalue': 0})
|
||||
|
@ -787,10 +786,10 @@ def test_wait_invoices(node_factory, executor):
|
|||
assert waitres == {'subsystem': 'invoices',
|
||||
'deleted': 1}
|
||||
|
||||
# Now check delexpiredinvoice works.
|
||||
# Now check autoclean works.
|
||||
waitfut = executor.submit(l2.rpc.call, 'wait', {'subsystem': 'invoices', 'indexname': 'deleted', 'nextvalue': 2})
|
||||
time.sleep(1)
|
||||
l2.rpc.delexpiredinvoice()
|
||||
time.sleep(2)
|
||||
l2.rpc.autoclean_once('expiredinvoices', 1)
|
||||
waitres = waitfut.result(TIMEOUT)
|
||||
|
||||
assert waitres == {'subsystem': 'invoices',
|
||||
|
|
|
@ -499,30 +499,6 @@ bool invoices_delete_description(struct invoices *invoices, u64 inv_dbid,
|
|||
return changes == 1;
|
||||
}
|
||||
|
||||
void invoices_delete_expired(struct invoices *invoices,
|
||||
u64 max_expiry_time)
|
||||
{
|
||||
u64 *ids = expired_ids(tmpctx, invoices->wallet->db, max_expiry_time,
|
||||
EXPIRED);
|
||||
|
||||
for (size_t i = 0; i < tal_count(ids); i++) {
|
||||
struct db_stmt *stmt;
|
||||
const struct invoice_details *details;
|
||||
|
||||
details = invoices_get_details(tmpctx, invoices, ids[i]);
|
||||
stmt = db_prepare_v2(invoices->wallet->db, SQL(
|
||||
"DELETE FROM invoices"
|
||||
" WHERE id = ?;"));
|
||||
db_bind_u64(stmt, ids[i]);
|
||||
db_exec_prepared_v2(take(stmt));
|
||||
|
||||
invoice_index_deleted(invoices->wallet->ld,
|
||||
details->state,
|
||||
details->label,
|
||||
details->invstring);
|
||||
}
|
||||
}
|
||||
|
||||
struct db_stmt *invoices_first(struct invoices *invoices,
|
||||
const enum wait_index *listindex,
|
||||
u64 liststart,
|
||||
|
|
|
@ -157,16 +157,6 @@ bool invoices_delete_description(struct invoices *invoices,
|
|||
const struct json_escape *label,
|
||||
const char *description);
|
||||
|
||||
/**
|
||||
* invoices_delete_expired - Delete all expired invoices
|
||||
* with expiration time less than or equal to the given.
|
||||
*
|
||||
* @invoices - the invoice handler.
|
||||
* @max_expiry_time - the maximum expiry time to delete.
|
||||
*/
|
||||
void invoices_delete_expired(struct invoices *invoices,
|
||||
u64 max_expiry_time);
|
||||
|
||||
/**
|
||||
* Iterate through all the invoices.
|
||||
* @invoices: the invoices
|
||||
|
|
|
@ -597,16 +597,6 @@ bool json_tok_streq(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|||
void kill_uncommitted_channel(struct uncommitted_channel *uc UNNEEDED,
|
||||
const char *why UNNEEDED)
|
||||
{ fprintf(stderr, "kill_uncommitted_channel called!\n"); abort(); }
|
||||
/* Generated stub for lightningd_deprecated_in_ok */
|
||||
bool lightningd_deprecated_in_ok(struct lightningd *ld UNNEEDED,
|
||||
struct logger *log UNNEEDED,
|
||||
bool deprecated_apis UNNEEDED,
|
||||
const char *subsys UNNEEDED,
|
||||
const char *api UNNEEDED,
|
||||
const char *start UNNEEDED,
|
||||
const char *end UNNEEDED,
|
||||
const char *details UNNEEDED)
|
||||
{ fprintf(stderr, "lightningd_deprecated_in_ok called!\n"); abort(); }
|
||||
/* Generated stub for lightningd_deprecated_out_ok */
|
||||
bool lightningd_deprecated_out_ok(struct lightningd *ld UNNEEDED,
|
||||
bool deprecated_apis UNNEEDED,
|
||||
|
@ -1110,9 +1100,6 @@ u8 *towire_invalid_onion_blinding(const tal_t *ctx UNNEEDED, const struct sha256
|
|||
/* Generated stub for towire_invalid_onion_payload */
|
||||
u8 *towire_invalid_onion_payload(const tal_t *ctx UNNEEDED, bigsize type UNNEEDED, u16 offset UNNEEDED)
|
||||
{ fprintf(stderr, "towire_invalid_onion_payload called!\n"); abort(); }
|
||||
/* Generated stub for towire_invalid_realm */
|
||||
u8 *towire_invalid_realm(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_invalid_realm called!\n"); abort(); }
|
||||
/* Generated stub for towire_onchaind_dev_memleak */
|
||||
u8 *towire_onchaind_dev_memleak(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_onchaind_dev_memleak called!\n"); abort(); }
|
||||
|
@ -1125,15 +1112,6 @@ u8 *towire_openingd_dev_memleak(const tal_t *ctx UNNEEDED)
|
|||
/* Generated stub for towire_permanent_channel_failure */
|
||||
u8 *towire_permanent_channel_failure(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_permanent_channel_failure called!\n"); abort(); }
|
||||
/* Generated stub for towire_permanent_node_failure */
|
||||
u8 *towire_permanent_node_failure(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_permanent_node_failure called!\n"); abort(); }
|
||||
/* Generated stub for towire_required_channel_feature_missing */
|
||||
u8 *towire_required_channel_feature_missing(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_required_channel_feature_missing called!\n"); abort(); }
|
||||
/* Generated stub for towire_required_node_feature_missing */
|
||||
u8 *towire_required_node_feature_missing(const tal_t *ctx UNNEEDED)
|
||||
{ fprintf(stderr, "towire_required_node_feature_missing called!\n"); abort(); }
|
||||
/* Generated stub for towire_scb_chan */
|
||||
void towire_scb_chan(u8 **p UNNEEDED, const struct scb_chan *scb_chan UNNEEDED)
|
||||
{ fprintf(stderr, "towire_scb_chan called!\n"); abort(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue