Get transaction's confirmation information (including block timestamp)#513
Open
robbiehanson wants to merge 1 commit intomasterfrom
Open
Get transaction's confirmation information (including block timestamp)#513robbiehanson wants to merge 1 commit intomasterfrom
robbiehanson wants to merge 1 commit intomasterfrom
Conversation
…uding block timestamp)
t-bast
reviewed
Jul 24, 2023
Member
There was a problem hiding this comment.
Concept ACK, but this will be cleaner to do on top of #512, which offers a direct getHeader() function on the IElectrumClient interface. After #512, we could also remove some duplication by having getConfirmationStatus internally call getConfirmations and simply follow up with getHeader().
My goal is to finalize #512 soon, so we should probably wait for this, even though it's a somewhat large change?
| data class ConfirmationStatus( | ||
| val minedAtBlockHeight: Int, | ||
| val currentConfirmationCount: Int, | ||
| val firstBlock: BlockHeader // includes timestamp of when block was mined |
Member
There was a problem hiding this comment.
nit:
Suggested change
| val firstBlock: BlockHeader // includes timestamp of when block was mined | |
| val includedInBlock: BlockHeader // includes timestamp of when block was mined |
Contributor
Author
Sounds good. Let's wait for 512, and then revisit. |
Member
|
@robbiehanson you can probably rebase that and do it more easily now! |
Member
|
@robbiehanson if you want this feature, you can rebase now and we should be able to integrate this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
OnChainOutgoingPaymenthas aconfirmedAttimestamp:Currently this is being set (in Phoenix) by monitoring the blockchain for unconfirmed tx's, and setting
confirmedAt = currentTimestampMillis(). However, the timestamp isn't ideal.It's usually the case that a user sends an on-chain payment, and then backgrounds the app. (Which means the socket connections are closed on iOS.) Only when the user returns to the app (possibly days later) do we realize that the payment was mined, and we set
confirmedAt = currentTimestampMillis(). Which, in this example, is days later than when the tx was actually mined.I'm proposing we add a method like this:
Using this function, we'll be able to set the
confirmedAtproperty to the timestamp of the block, which would be more accurate.