listtransactions: remove annotations, which were only in EXPERIMENTAL_FEATURES.

I don't know if anyone was using them, they seem half-hearted.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-05-22 10:21:44 +09:30
parent 4deb552fe9
commit b8aa3a579e
11 changed files with 6 additions and 304 deletions

View File

@@ -758,47 +758,15 @@ message ListtransactionsTransactions {
} }
message ListtransactionsTransactionsInputs { message ListtransactionsTransactionsInputs {
// ListTransactions.transactions[].inputs[].type
enum ListtransactionsTransactionsInputsType {
THEIRS = 0;
DEPOSIT = 1;
WITHDRAW = 2;
CHANNEL_FUNDING = 3;
CHANNEL_MUTUAL_CLOSE = 4;
CHANNEL_UNILATERAL_CLOSE = 5;
CHANNEL_SWEEP = 6;
CHANNEL_HTLC_SUCCESS = 7;
CHANNEL_HTLC_TIMEOUT = 8;
CHANNEL_PENALTY = 9;
CHANNEL_UNILATERAL_CHEAT = 10;
}
bytes txid = 1; bytes txid = 1;
uint32 index = 2; uint32 index = 2;
uint32 sequence = 3; uint32 sequence = 3;
optional ListtransactionsTransactionsInputsType item_type = 4;
optional string channel = 5;
} }
message ListtransactionsTransactionsOutputs { message ListtransactionsTransactionsOutputs {
// ListTransactions.transactions[].outputs[].type
enum ListtransactionsTransactionsOutputsType {
THEIRS = 0;
DEPOSIT = 1;
WITHDRAW = 2;
CHANNEL_FUNDING = 3;
CHANNEL_MUTUAL_CLOSE = 4;
CHANNEL_UNILATERAL_CLOSE = 5;
CHANNEL_SWEEP = 6;
CHANNEL_HTLC_SUCCESS = 7;
CHANNEL_HTLC_TIMEOUT = 8;
CHANNEL_PENALTY = 9;
CHANNEL_UNILATERAL_CHEAT = 10;
}
uint32 index = 1; uint32 index = 1;
Amount amount_msat = 6; Amount amount_msat = 6;
bytes scriptPubKey = 3; bytes scriptPubKey = 3;
optional ListtransactionsTransactionsOutputsType item_type = 4;
optional string channel = 5;
} }
message PayRequest { message PayRequest {

View File

@@ -627,8 +627,6 @@ impl From<responses::ListtransactionsTransactionsInputs> for pb::Listtransaction
txid: hex::decode(&c.txid).unwrap(), // Rule #2 for type txid txid: hex::decode(&c.txid).unwrap(), // Rule #2 for type txid
index: c.index, // Rule #2 for type u32 index: c.index, // Rule #2 for type u32
sequence: c.sequence, // Rule #2 for type u32 sequence: c.sequence, // Rule #2 for type u32
item_type: c.item_type.map(|v| v as i32),
channel: c.channel.map(|v| v.to_string()), // Rule #2 for type short_channel_id?
} }
} }
} }
@@ -640,8 +638,6 @@ impl From<responses::ListtransactionsTransactionsOutputs> for pb::Listtransactio
index: c.index, // Rule #2 for type u32 index: c.index, // Rule #2 for type u32
amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat amount_msat: Some(c.amount_msat.into()), // Rule #2 for type msat
script_pub_key: hex::decode(&c.script_pub_key).unwrap(), // Rule #2 for type hex script_pub_key: hex::decode(&c.script_pub_key).unwrap(), // Rule #2 for type hex
item_type: c.item_type.map(|v| v as i32),
channel: c.channel.map(|v| v.to_string()), // Rule #2 for type short_channel_id?
} }
} }
} }

100
cln-rpc/src/model.rs generated
View File

@@ -2601,119 +2601,19 @@ pub mod responses {
} }
} }
/// the purpose of this input (*EXPERIMENTAL_FEATURES* only)
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListtransactionsTransactionsInputsType {
#[serde(rename = "theirs")]
THEIRS,
#[serde(rename = "deposit")]
DEPOSIT,
#[serde(rename = "withdraw")]
WITHDRAW,
#[serde(rename = "channel_funding")]
CHANNEL_FUNDING,
#[serde(rename = "channel_mutual_close")]
CHANNEL_MUTUAL_CLOSE,
#[serde(rename = "channel_unilateral_close")]
CHANNEL_UNILATERAL_CLOSE,
#[serde(rename = "channel_sweep")]
CHANNEL_SWEEP,
#[serde(rename = "channel_htlc_success")]
CHANNEL_HTLC_SUCCESS,
#[serde(rename = "channel_htlc_timeout")]
CHANNEL_HTLC_TIMEOUT,
#[serde(rename = "channel_penalty")]
CHANNEL_PENALTY,
#[serde(rename = "channel_unilateral_cheat")]
CHANNEL_UNILATERAL_CHEAT,
}
impl TryFrom<i32> for ListtransactionsTransactionsInputsType {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListtransactionsTransactionsInputsType, anyhow::Error> {
match c {
0 => Ok(ListtransactionsTransactionsInputsType::THEIRS),
1 => Ok(ListtransactionsTransactionsInputsType::DEPOSIT),
2 => Ok(ListtransactionsTransactionsInputsType::WITHDRAW),
3 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_FUNDING),
4 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_MUTUAL_CLOSE),
5 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_UNILATERAL_CLOSE),
6 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_SWEEP),
7 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_HTLC_SUCCESS),
8 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_HTLC_TIMEOUT),
9 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_PENALTY),
10 => Ok(ListtransactionsTransactionsInputsType::CHANNEL_UNILATERAL_CHEAT),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListtransactionsTransactionsInputsType", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListtransactionsTransactionsInputs { pub struct ListtransactionsTransactionsInputs {
pub txid: String, pub txid: String,
pub index: u32, pub index: u32,
pub sequence: u32, pub sequence: u32,
#[serde(skip_serializing_if = "Option::is_none")]
pub item_type: Option<ListtransactionsTransactionsInputsType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub channel: Option<ShortChannelId>,
} }
/// the purpose of this output (*EXPERIMENTAL_FEATURES* only)
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListtransactionsTransactionsOutputsType {
#[serde(rename = "theirs")]
THEIRS,
#[serde(rename = "deposit")]
DEPOSIT,
#[serde(rename = "withdraw")]
WITHDRAW,
#[serde(rename = "channel_funding")]
CHANNEL_FUNDING,
#[serde(rename = "channel_mutual_close")]
CHANNEL_MUTUAL_CLOSE,
#[serde(rename = "channel_unilateral_close")]
CHANNEL_UNILATERAL_CLOSE,
#[serde(rename = "channel_sweep")]
CHANNEL_SWEEP,
#[serde(rename = "channel_htlc_success")]
CHANNEL_HTLC_SUCCESS,
#[serde(rename = "channel_htlc_timeout")]
CHANNEL_HTLC_TIMEOUT,
#[serde(rename = "channel_penalty")]
CHANNEL_PENALTY,
#[serde(rename = "channel_unilateral_cheat")]
CHANNEL_UNILATERAL_CHEAT,
}
impl TryFrom<i32> for ListtransactionsTransactionsOutputsType {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListtransactionsTransactionsOutputsType, anyhow::Error> {
match c {
0 => Ok(ListtransactionsTransactionsOutputsType::THEIRS),
1 => Ok(ListtransactionsTransactionsOutputsType::DEPOSIT),
2 => Ok(ListtransactionsTransactionsOutputsType::WITHDRAW),
3 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_FUNDING),
4 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_MUTUAL_CLOSE),
5 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_UNILATERAL_CLOSE),
6 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_SWEEP),
7 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_HTLC_SUCCESS),
8 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_HTLC_TIMEOUT),
9 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_PENALTY),
10 => Ok(ListtransactionsTransactionsOutputsType::CHANNEL_UNILATERAL_CHEAT),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListtransactionsTransactionsOutputsType", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListtransactionsTransactionsOutputs { pub struct ListtransactionsTransactionsOutputs {
pub index: u32, pub index: u32,
pub amount_msat: Amount, pub amount_msat: Amount,
#[serde(rename = "scriptPubKey")] #[serde(rename = "scriptPubKey")]
pub script_pub_key: String, pub script_pub_key: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub item_type: Option<ListtransactionsTransactionsOutputsType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub channel: Option<ShortChannelId>,
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]

View File

@@ -489,8 +489,6 @@ def listtransactions_transactions_inputs2py(m):
"txid": hexlify(m.txid), # PrimitiveField in generate_composite "txid": hexlify(m.txid), # PrimitiveField in generate_composite
"index": m.index, # PrimitiveField in generate_composite "index": m.index, # PrimitiveField in generate_composite
"sequence": m.sequence, # PrimitiveField in generate_composite "sequence": m.sequence, # PrimitiveField in generate_composite
"type": str(m.item_type), # EnumField in generate_composite
"channel": m.channel, # PrimitiveField in generate_composite
}) })
@@ -499,8 +497,6 @@ def listtransactions_transactions_outputs2py(m):
"index": m.index, # PrimitiveField in generate_composite "index": m.index, # PrimitiveField in generate_composite
"amount_msat": amount2msat(m.amount_msat), # PrimitiveField in generate_composite "amount_msat": amount2msat(m.amount_msat), # PrimitiveField in generate_composite
"script_pub_key": hexlify(m.script_pub_key), # PrimitiveField in generate_composite "script_pub_key": hexlify(m.script_pub_key), # PrimitiveField in generate_composite
"type": str(m.item_type), # EnumField in generate_composite
"channel": m.channel, # PrimitiveField in generate_composite
}) })

View File

@@ -237,7 +237,7 @@ schema-added-check:
fi fi
schema-removed-check: schema-removed-check:
@if ! test -z $$CI; then git fetch origin master; fi; \ @if ! test -z $$CI; then git fetch origin master; fi; \
if git diff origin/master -- doc/schemas | grep -q '^-.*{' && ! git diff origin/master -- doc/schemas | grep -q '^-.*"deprecated"'; then \ if git diff origin/master -- doc/schemas | grep -q '^-.*{' && ! git diff origin/master -- doc/schemas | grep -q '^-.*"deprecated"' && ! git diff origin/master -- doc/schemas | grep -q '^-.*EXPERIMENTAL_FEATURES'; then \
git diff origin/master -- doc/schemas ; \ git diff origin/master -- doc/schemas ; \
echo 'Schema fields must be "deprecated", with version, not removed' >&2; exit 1; \ echo 'Schema fields must be "deprecated", with version, not removed' >&2; exit 1; \
fi fi

View File

@@ -37,14 +37,10 @@ On success, an object containing **transactions** is returned. It is an array o
- **txid** (txid): the transaction id spent - **txid** (txid): the transaction id spent
- **index** (u32): the output spent - **index** (u32): the output spent
- **sequence** (u32): the nSequence value - **sequence** (u32): the nSequence value
- **type** (string, optional): the purpose of this input (*EXPERIMENTAL\_FEATURES* only) (one of "theirs", "deposit", "withdraw", "channel\_funding", "channel\_mutual\_close", "channel\_unilateral\_close", "channel\_sweep", "channel\_htlc\_success", "channel\_htlc\_timeout", "channel\_penalty", "channel\_unilateral\_cheat")
- **channel** (short\_channel\_id, optional): the channel this input is associated with (*EXPERIMENTAL\_FEATURES* only)
- **outputs** (array of objects): Each output, in order: - **outputs** (array of objects): Each output, in order:
- **index** (u32): the 0-based output number - **index** (u32): the 0-based output number
- **amount\_msat** (msat): the amount of the output - **amount\_msat** (msat): the amount of the output
- **scriptPubKey** (hex): the scriptPubKey - **scriptPubKey** (hex): the scriptPubKey
- **type** (string, optional): the purpose of this output (*EXPERIMENTAL\_FEATURES* only) (one of "theirs", "deposit", "withdraw", "channel\_funding", "channel\_mutual\_close", "channel\_unilateral\_close", "channel\_sweep", "channel\_htlc\_success", "channel\_htlc\_timeout", "channel\_penalty", "channel\_unilateral\_cheat")
- **channel** (short\_channel\_id, optional): the channel this output is associated with (*EXPERIMENTAL\_FEATURES* only)
[comment]: # (GENERATE-FROM-SCHEMA-END) [comment]: # (GENERATE-FROM-SCHEMA-END)
@@ -103,4 +99,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning> Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:525f24511eb9687dc16d5b2156d4d8df28b371e287512a749d2d9dfd5701e093) [comment]: # ( SHA256STAMP:6431aec91a48a5f9d4632baa6f3aae23dee8607a200b3c359d679028e521b588)

View File

@@ -379,16 +379,12 @@ The following tables are currently supported:
- `txid` (type `txid`, sqltype `BLOB`) - `txid` (type `txid`, sqltype `BLOB`)
- `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)
- `sequence` (type `u32`, sqltype `INTEGER`) - `sequence` (type `u32`, sqltype `INTEGER`)
- `type` (type `string`, sqltype `TEXT`)
- `channel` (type `short_channel_id`, sqltype `TEXT`)
- related table `transactions_outputs` - related table `transactions_outputs`
- `row` (reference to `transactions.rowid`, sqltype `INTEGER`) - `row` (reference to `transactions.rowid`, sqltype `INTEGER`)
- `arrindex` (index within array, sqltype `INTEGER`) - `arrindex` (index within array, sqltype `INTEGER`)
- `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`) - `idx` (type `u32`, sqltype `INTEGER`, from JSON field `index`)
- `amount_msat` (type `msat`, sqltype `INTEGER`) - `amount_msat` (type `msat`, sqltype `INTEGER`)
- `scriptPubKey` (type `hex`, sqltype `BLOB`) - `scriptPubKey` (type `hex`, sqltype `BLOB`)
- `type` (type `string`, sqltype `TEXT`)
- `channel` (type `short_channel_id`, sqltype `TEXT`)
[comment]: # (GENERATE-DOC-END) [comment]: # (GENERATE-DOC-END)
@@ -514,4 +510,4 @@ RESOURCES
--------- ---------
Main web site: <https://github.com/ElementsProject/lightning> Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:3eb4e024a1e1a4b40460b48b835354514456558797b8f8ce3c76dcbb9ca79dab) [comment]: # ( SHA256STAMP:68c72c66bdc8b0515c6d5dddd5ffd14aa0342bd00f17a44929177c48c36a213f)

View File

@@ -69,27 +69,6 @@
"sequence": { "sequence": {
"type": "u32", "type": "u32",
"description": "the nSequence value" "description": "the nSequence value"
},
"type": {
"type": "string",
"enum": [
"theirs",
"deposit",
"withdraw",
"channel_funding",
"channel_mutual_close",
"channel_unilateral_close",
"channel_sweep",
"channel_htlc_success",
"channel_htlc_timeout",
"channel_penalty",
"channel_unilateral_cheat"
],
"description": "the purpose of this input (*EXPERIMENTAL_FEATURES* only)"
},
"channel": {
"type": "short_channel_id",
"description": "the channel this input is associated with (*EXPERIMENTAL_FEATURES* only)"
} }
} }
} }
@@ -117,27 +96,6 @@
"scriptPubKey": { "scriptPubKey": {
"type": "hex", "type": "hex",
"description": "the scriptPubKey" "description": "the scriptPubKey"
},
"type": {
"type": "string",
"enum": [
"theirs",
"deposit",
"withdraw",
"channel_funding",
"channel_mutual_close",
"channel_unilateral_close",
"channel_sweep",
"channel_htlc_success",
"channel_htlc_timeout",
"channel_penalty",
"channel_unilateral_cheat"
],
"description": "the purpose of this output (*EXPERIMENTAL_FEATURES* only)"
},
"channel": {
"type": "short_channel_id",
"description": "the channel this output is associated with (*EXPERIMENTAL_FEATURES* only)"
} }
} }
} }

View File

@@ -3914,11 +3914,7 @@ def test_sql(node_factory, bitcoind):
{'name': 'idx', {'name': 'idx',
'type': 'u32'}, 'type': 'u32'},
{'name': 'sequence', {'name': 'sequence',
'type': 'u32'}, 'type': 'u32'}]},
{'name': 'type',
'type': 'string'},
{'name': 'channel',
'type': 'short_channel_id'}]},
'transactions_outputs': { 'transactions_outputs': {
'columns': [{'name': 'row', 'columns': [{'name': 'row',
'type': 'u64'}, 'type': 'u64'},
@@ -3929,11 +3925,7 @@ def test_sql(node_factory, bitcoind):
{'name': 'amount_msat', {'name': 'amount_msat',
'type': 'msat'}, 'type': 'msat'},
{'name': 'scriptPubKey', {'name': 'scriptPubKey',
'type': 'hex'}, 'type': 'hex'}]},
{'name': 'type',
'type': 'string'},
{'name': 'channel',
'type': 'short_channel_id'}]},
'bkpr_accountevents': { 'bkpr_accountevents': {
'columns': [{'name': 'account', 'columns': [{'name': 'account',
'type': 'string'}, 'type': 'string'},

View File

@@ -5,7 +5,7 @@ from fixtures import TEST_NETWORK
from pyln.client import RpcError, Millisatoshi from pyln.client import RpcError, Millisatoshi
from shutil import copyfile from shutil import copyfile
from utils import ( from utils import (
only_one, wait_for, sync_blockheight, EXPERIMENTAL_FEATURES, only_one, wait_for, sync_blockheight,
VALGRIND, check_coin_moves, TailableProc, scriptpubkey_addr, VALGRIND, check_coin_moves, TailableProc, scriptpubkey_addr,
check_utxos_channel check_utxos_channel
) )
@@ -1065,78 +1065,6 @@ def test_txsend(node_factory, bitcoind, chainparams):
assert scriptpubkey_addr(decode['vout'][changenum]['scriptPubKey']) in [f['address'] for f in l1.rpc.listfunds()['outputs']] assert scriptpubkey_addr(decode['vout'][changenum]['scriptPubKey']) in [f['address'] for f in l1.rpc.listfunds()['outputs']]
@unittest.skipIf(TEST_NETWORK != 'regtest', "Fee outputs throw off our output matching logic")
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Tests annotations which are compiled only with experimental features")
def test_transaction_annotations(node_factory, bitcoind):
l1, l2, l3 = node_factory.get_nodes(3)
l1.fundwallet(10**6)
# We should now have a transaction that gave us the funds in the
# transactions table...
outputs = l1.rpc.listfunds()['outputs']
assert(len(outputs) == 1 and outputs[0]['status'] == 'confirmed')
out = outputs[0]
idx = out['output']
assert(idx in [0, 1] and out['amount_msat'] == Millisatoshi("{}sat".format(10**6)))
# ... and it should have an annotation on the output reading 'deposit'
txs = l1.rpc.listtransactions()['transactions']
assert(len(txs) == 1)
tx = txs[0]
output = tx['outputs'][idx]
assert(output['type'] == 'deposit' and output['amount_msat'] == Millisatoshi(1000000000))
# ... and all other output should be change, and have no annotations
types = []
for i, o in enumerate(tx['outputs']):
if i == idx:
continue
if 'type' in o:
types.append(o['type'])
else:
types.append(None)
assert(set([None]) == set(types))
##########################################################################
# Let's now open a channel. The opener should get the funding transaction
# annotated as channel open and deposit.
l1.connect(l2)
fundingtx = l1.rpc.fundchannel(l2.info['id'], 10**5)
# We should have one output unreserved, and it should be unconfirmed
outputs = l1.rpc.listfunds()['outputs']
assert len(outputs) == 2
outputs = [o for o in outputs if not o['reserved']]
assert(len(outputs) == 1 and outputs[0]['status'] == 'unconfirmed')
# It should also match the funding txid:
assert(outputs[0]['txid'] == fundingtx['txid'])
# Confirm the channel and check that the output changed to confirmed
bitcoind.generate_block(3)
sync_blockheight(bitcoind, [l1, l2])
outputs = l1.rpc.listfunds()['outputs']
assert(len(outputs) == 1 and outputs[0]['status'] == 'confirmed')
# We should have 2 transactions, the second one should be the funding tx
# (we are ordering by blockheight and txindex, so that order should be ok)
txs = l1.rpc.listtransactions()['transactions']
assert(len(txs) == 2 and txs[1]['hash'] == fundingtx['txid'])
# Check the annotated types
types = [o['type'] for o in txs[1]['outputs']]
changeidx = 0 if types[0] == 'deposit' else 1
fundidx = 1 - changeidx
assert(types[changeidx] == 'deposit' and types[fundidx] == 'channel_funding')
# And check the channel annotation on the funding output
channels = l1.rpc.listpeerchannels()['channels']
assert(len(channels) == 1)
scid = channels[0]['short_channel_id']
assert(txs[1]['outputs'][fundidx]['channel'] == scid)
def write_all(fd, bytestr): def write_all(fd, bytestr):
"""Wrapper, since os.write can do partial writes""" """Wrapper, since os.write can do partial writes"""
off = 0 off = 0

View File

@@ -484,16 +484,6 @@ struct {
{TX_CHANNEL_CHEAT, "channel_unilateral_cheat"}, {TX_CHANNEL_CHEAT, "channel_unilateral_cheat"},
}; };
#if EXPERIMENTAL_FEATURES
static const char *txtype_to_string(enum wallet_tx_type t)
{
for (size_t i = 0; i < ARRAY_SIZE(wallet_tx_type_display_names); i++)
if (t == wallet_tx_type_display_names[i].t)
return wallet_tx_type_display_names[i].name;
return NULL;
}
#endif
static void json_transaction_details(struct json_stream *response, static void json_transaction_details(struct json_stream *response,
const struct wallet_transaction *tx) const struct wallet_transaction *tx)
{ {
@@ -517,15 +507,6 @@ static void json_transaction_details(struct json_stream *response,
json_add_txid(response, "txid", &prevtxid); json_add_txid(response, "txid", &prevtxid);
json_add_u32(response, "index", in->index); json_add_u32(response, "index", in->index);
json_add_u32(response, "sequence", in->sequence); json_add_u32(response, "sequence", in->sequence);
#if EXPERIMENTAL_FEATURES
struct tx_annotation *ann = &tx->input_annotations[i];
const char *txtype = txtype_to_string(ann->type);
if (txtype != NULL)
json_add_string(response, "type", txtype);
if (ann->channel.u64 != 0)
json_add_short_channel_id(response, "channel", &ann->channel);
#endif
json_object_end(response); json_object_end(response);
} }
json_array_end(response); json_array_end(response);
@@ -547,15 +528,6 @@ static void json_transaction_details(struct json_stream *response,
json_add_u32(response, "index", i); json_add_u32(response, "index", i);
json_add_amount_sat_msat(response, "amount_msat", sat); json_add_amount_sat_msat(response, "amount_msat", sat);
#if EXPERIMENTAL_FEATURES
struct tx_annotation *ann = &tx->output_annotations[i];
const char *txtype = txtype_to_string(ann->type);
if (txtype != NULL)
json_add_string(response, "type", txtype);
if (ann->channel.u64 != 0)
json_add_short_channel_id(response, "channel", &ann->channel);
#endif
json_add_hex(response, "scriptPubKey", out->script, out->script_len); json_add_hex(response, "scriptPubKey", out->script, out->script_len);
json_object_end(response); json_object_end(response);