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

Changes to show checkpointedness of transactions #866

merged 3 commits into from Oct 3, 2019


Copy link

commented Oct 3, 2019

With show_transfers

132272  miner   locked checkpointed 2019-10-02 07:34         23.533008373 67192cb1c75968511d2c888a1e9007a7b54da873eb6edfbb430b27559c6c3cb0 0000000000000000    0.000000000 - 0 -
132282  miner   locked           no 2019-10-02 07:52         23.531838962 7bc31379ba626ea73f105603689c0e2dc2d42934f2fca6f6277dc8296637bc41 0000000000000000    0.000000000 - 0 - 

With show_transfer 67192cb1c75968511d2c888a1e9007a7b54da873eb6edfbb430b27559c6c3cb0

Incoming transaction found
txid: <67192cb1c75968511d2c888a1e9007a7b54da873eb6edfbb430b27559c6c3cb0>
Height: 132272
Timestamp: 2019-10-02 07:34:33
Amount: 23.533008373
Payment ID: 0000000000000000
Locked: 23 blocks to unlock
Checkpointed: Yes
Address index: 0

In export_transfers

   block,     type,    lock,  checkpointed,       timestamp,              amount,     running balance,                                                            hash,      payment ID,           fee,                                                                                         destination,              amount,index,note
       1,    miner,unlocked,  checkpointed,2019-03-07 09:14,       116.603178672,       116.603178672,f8c621b85c86fc4e1f3c0f93954cd28a941ebe1ae5998d0bf0198ccf504c47ab,0000000000000000,   0.000000000,                                                                                                   -,                    ,"0",
       2,    miner,unlocked,  checkpointed,2019-03-07 09:14,       121.597967646,       238.201146318,dd4dd84f255c457bcf937e4a146193043f9e1318dabe00cd1cde60d8929f493b,0000000000000000,   0.000000000,                                                                                                   -,                    ,"0",

In get_transfers, new field is added, checkpointed

      "address": "T6UF17LpAFF64Agf5uPZp87FaHsSxGMKbJpF5RTqcoNCGMciaqKcw8bVv4p5XeY9kZ7RnRjVpdrtLMosWHH85Kt12qk5JVcrj",
      "amount": 56575491211,
      "checkpointed": 1,
      "confirmations": 130130,
      "double_spend_seen": false,
      "fee": 0,
      "height": 2153,
      "note": "",
      "payment_id": "0000000000000000",
      "subaddr_index": {
        "major": 0,
        "minor": 0
      "subaddr_indices": [{
        "major": 0,
        "minor": 0
      "suggested_confirmations_threshold": 2,
      "timestamp": 1552194104,
      "txid": "1dba532778b34453948808cd7e4638e4af1434196436d9396e3a491670c9b12a",
      "type": "miner",
      "unlock_time": 2183


This also merges transfer_view and transfer_entry which are duplicated and server mostly the same purpose to one unified structure. Also fixes crash bug on get_transfers.


This comment has been minimized.

Copy link

commented Oct 3, 2019

Does "checkpointed" here mean immutable, i.e. 2 checkpoints?

Edit: never mind, I see it does.

if (res)
return res;
height = m_immutable_height;
return boost::optional<std::string>();

This comment has been minimized.

Copy link

jagerman Oct 3, 2019

The empty case is more commonly return boost::none;, but I see nothing else here is doing that so I guess leave it. 😞

@@ -494,6 +494,7 @@ namespace tools
bool double_spend_seen; // True if the key image(s) for the transfer have been seen before.
uint64_t confirmations; // Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).
uint64_t suggested_confirmations_threshold;
bool checkpointed = false; // If the transfer is backed by atleast (2 service node|| 1 hardcoded) checkpoints // TODO(loki): Make this count the number of checkpoints backing this transfer

This comment has been minimized.

Copy link

jagerman Oct 3, 2019

This TODO would be nice, but I expect it is actually fairly tricky/expensive to calculate.

This comment has been minimized.

Copy link

Doy-lee Oct 3, 2019

Author Collaborator

Indeed. Non trivial atm, considering checkpoints can arrive out of order.

@Doy-lee Doy-lee merged commit 18b0aed into loki-project:dev Oct 3, 2019
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.