Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[list_channels] created_at precision is too high #287

Open
gpBlockchain opened this issue Oct 24, 2024 · 2 comments
Open

[list_channels] created_at precision is too high #287

gpBlockchain opened this issue Oct 24, 2024 · 2 comments

Comments

@gpBlockchain
Copy link

created_at: 0x62534d6ccbd30 = 1729758732533040
The current timestamp is in microseconds, would using milliseconds be better?

curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "list_channels",
    "params": [
        {}
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"channels": [{"channel_id": "0xc871d87963daccca819aeb9aa0aedfbfe7b3123a81172a9a31862970d4725d55", "peer_id": "QmbkfCNjtURzyPrVP6mtBB3Sg2q3zUpxeu2v4hwP4HPVMW", "funding_udt_type_script": null, "state": {"state_name": "CHANNEL_READY", "state_flags": []}, "local_balance": "0x11d83b158", "offered_tlc_balance": "0x0", "remote_balance": "0x2190798a8", "received_tlc_balance": "0x0", "created_at": "0x62534d6ccbd30"}]}, "id": 42}
@contrun
Copy link
Collaborator

contrun commented Oct 25, 2024

Also: I don't know if we should use format "0x62534d6ccbd30" to display timestamps. It is not quite user-friendly.

@gpBlockchain
Copy link
Author

Also: I don't know if we should use format "0x62534d6ccbd30" to display timestamps. It is not quite user-friendly.

Millisecond-level precision for timestamp in get_invoice

curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "get_invoice",
    "params": [
        {
            "payment_hash": "0x382e8307a1d94ca335a7a6d067d4c148c39e3c9a442aae620df7a61a8ba2081f"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"invoice_address": "fibd11peseucdphcxgfw0pnm6vk2jcsfkqk06agka5smfxcvs47ekw40suauu4sa87csdwvs8uk8knh0kmn6ucngltzh0wjarlr5s4dd8vnthnt8svm6zdzsh8tvwvh5sph9jyjrxfpyxu5c6vlmq2t8427dhxerva9swcwkfg729g4q3d48qutp93cj3xfq8e92jcfdd63y7flp4hgfksr5n4m9h97kearvmkrr9uk9p7wezltxhgtlncnpte7u0lvn5w5hc2usarna6hmpwxnjhtgnpgkech42dzmrwwn5emxrzzwznu2wq4tw5fe58r2ql508dzx0a0sylcw9yn3c7jxk4m67fpwm8mqecrksljtgq94tdxa", "invoice": {"currency": "Fibd", "amount": "0x1", "signature": "0a1c101d03131d1a171b010e061312170b0813010816191817150a0d021b030e0e1314191b060302020e02131c0a0e00150b0e1409191407030a001f140f070d02060f1d0f10041f180e05041311181e120616151b1a1e09010e1b071b0019180316101f120b0800", "data": {"timestamp": "0x1932b3e3d2b", "payment_hash": "0x382e8307a1d94ca335a7a6d067d4c148c39e3c9a442aae620df7a61a8ba2081f", "attrs": [{"Description": "test invoice generated by node2"}, {"ExpiryTime": {"secs": 3600, "nanos": 0}}, {"HashAlgorithm": "sha256"}, {"PayeePublicKey": "02303e6cbd8e7725c917559035710df3f5e700b7a59c8fe3a855a1fdfbe995b6c8"}]}}, "status": "Open"}, "id": 42}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants