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

Remove duplicate TXIN_BASE_WEIGHT from new_tr_keyspend #32

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

cygnet3
Copy link
Contributor

@cygnet3 cygnet3 commented Jan 29, 2025

Removes the duplicate TXIN_BASE_WEIGHT when calling Candidate::new_tr_keyspend.

Closes #31

@cygnet3 cygnet3 force-pushed the fix-new-tr-keyspend branch from 00cdc23 to 4262a82 Compare January 29, 2025 00:16
@cygnet3 cygnet3 changed the title Remove duplicate TXIN_BASE_WEIGHT from new_tr_keyspend #31 Remove duplicate TXIN_BASE_WEIGHT from new_tr_keyspend Jan 29, 2025
Copy link
Collaborator

@LLFourn LLFourn left a comment

Choose a reason for hiding this comment

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

tACK 4c9b73ed8b04a456ab10cdb9e7fa162b8a6a91b6

@@ -655,7 +655,7 @@ pub struct Candidate {
impl Candidate {
/// Create a [`Candidate`] input that spends a single taproot keyspend output.
pub fn new_tr_keyspend(value: u64) -> Self {
let weight = TXIN_BASE_WEIGHT + TR_KEYSPEND_SATISFACTION_WEIGHT;
let weight = TR_KEYSPEND_SATISFACTION_WEIGHT;
Copy link
Collaborator

@LLFourn LLFourn Jan 29, 2025

Choose a reason for hiding this comment

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

Wait did you mean to use TR_KEYSPEND_TXIN_WEIGHT.

EDIT -- oh no I see now.

@LLFourn
Copy link
Collaborator

LLFourn commented Jan 29, 2025

I added a test. Will fix the ci in a moment.

@LLFourn LLFourn force-pushed the fix-new-tr-keyspend branch from 4262a82 to 52767a4 Compare January 29, 2025 03:52
@LLFourn LLFourn merged commit 40597a0 into bitcoindevkit:master Jan 29, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

Bug: Using Candidate::new_tr_keyspend adds TXIN_BASE_WEIGHT twice to the weight
2 participants