Skip to content

Commit

Permalink
Merge pull request #330 from chenyukang/yukang-fix-timestamp-graph-ch…
Browse files Browse the repository at this point in the history
…annel

Fix timestamp format for RPC graph_channel
  • Loading branch information
quake authored Nov 21, 2024
2 parents 78a4da8 + 4478629 commit 828a02b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/fiber/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ where
}

pub(crate) fn load_from_store(&mut self) {
let channels = self.store.get_channels(None);
for channel in channels.iter() {
for channel in self.store.get_channels(None).iter() {
if self.best_height < channel.funding_tx_block_number() {
self.best_height = channel.funding_tx_block_number();
}
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ The Channel information.
* `funding_tx_index` - u32, The index of the funding transaction.
* `node1` - Pubkey, The node ID of the first node.
* `node2` - Pubkey, The node ID of the second node.
* `last_updated_timestamp` - `Option<u64>`, The last updated timestamp of the channel.
* `created_timestamp` - u64, The created timestamp of the channel.
* `last_updated_timestamp` - `Option<u64>`, The last updated timestamp of the channel, milliseconds since UNIX epoch.
* `created_timestamp` - u64, The created timestamp of the channel, milliseconds since UNIX epoch.
* `node1_to_node2_fee_rate` - `Option<u64>`, The fee rate from node 1 to node 2.
* `node2_to_node1_fee_rate` - `Option<u64>`, The fee rate from node 2 to node 1.
* `capacity` - u128, The capacity of the channel.
Expand Down
5 changes: 3 additions & 2 deletions src/rpc/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ struct ChannelInfo {
node1: Pubkey,
/// The node ID of the second node.
node2: Pubkey,
/// The last updated timestamp of the channel.
/// The last updated timestamp of the channel, milliseconds since UNIX epoch.
#[serde_as(as = "Option<U64Hex>")]
last_updated_timestamp: Option<u64>,
/// The created timestamp of the channel.
/// The created timestamp of the channel, milliseconds since UNIX epoch.
#[serde_as(as = "U64Hex")]
created_timestamp: u64,
#[serde_as(as = "Option<U64Hex>")]
/// The fee rate from node 1 to node 2.
Expand Down

0 comments on commit 828a02b

Please sign in to comment.