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

Allow for funding transactions with unconfirmed outputs #722

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

ChrisSchinnerl
Copy link
Member

No description provided.

@ChrisSchinnerl ChrisSchinnerl self-assigned this Nov 7, 2023
@ChrisSchinnerl ChrisSchinnerl marked this pull request as ready for review November 7, 2023 13:49
@@ -168,7 +168,9 @@ func (w *SingleAddressWallet) Balance() (spendable, confirmed, unconfirmed types
confirmed = confirmed.Add(sce.Value)
}
for _, sco := range w.tpoolUtxos {
unconfirmed = unconfirmed.Add(sco.Value)
if !w.isOutputUsed(sco.ID) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably fine but I was expecting a check against tpoolSpent here, what's the difference between tpoolSpent and tpoolUtxos, to me it seems like they're the same thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to check for both the used timestamp as well as tpoolSpent within isOutputUsed.

tpoolSpent indicates whether an output is spent according to the transaction pool
tpoolUtxos tracks all outputs in the transaction pool, even the spent ones

@ChrisSchinnerl ChrisSchinnerl merged commit 01b3ccb into master Nov 9, 2023
6 checks passed
@ChrisSchinnerl ChrisSchinnerl deleted the chris/wallet-fund-unconfirmed-txns branch November 9, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants