-
Notifications
You must be signed in to change notification settings - Fork 492
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
[trivial] Services
: Add SmartHeaderChain
#11522
[trivial] Services
: Add SmartHeaderChain
#11522
Conversation
Services
: Add SmartHeaderChain
Services
: Add SmartHeaderChain
@@ -24,7 +24,7 @@ public static LabelsArray GetLabels(this SmartCoin coin, int privateThreshold) | |||
return coin.HdPubKey.Cluster.Labels; | |||
} | |||
|
|||
public static int GetConfirmations(this SmartCoin coin) => coin.Height.Type == HeightType.Chain ? (int)Services.BitcoinStore.SmartHeaderChain.TipHeight - coin.Height.Value + 1 : 0; | |||
public static int GetConfirmations(this SmartCoin coin) => coin.Height.Type == HeightType.Chain ? (int)Services.SmartHeaderChain.TipHeight - coin.Height.Value + 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole function feels like a duplicate.
WDYT of this?
public static int GetConfirmations(this SmartCoin coin) => coin.Transaction.GetConfirmations((int)Services.BitcoinStore.SmartHeaderChain.TipHeight);
As SmartCoin
has its own SmartTransaction
, we could use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shit, I forgot that the SmartTransaction.GetConfirmations
extension method is not yet on master
. 😅
EDIT: If you merge master
now, it's there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. I'll leave it for a follow-up PR but you can create a PR if you like.
# Conflicts: # WalletWasabi.Fluent/Extensions/TransactionSummaryExtensions.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
No description provided.