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

ltc: switch to segwit #1554

Merged
merged 1 commit into from
Apr 6, 2022
Merged

ltc: switch to segwit #1554

merged 1 commit into from
Apr 6, 2022

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Mar 30, 2022

Rebased on #1553 so the "livetest" simnet test can actually succeed.

This switches the LTC code to using and requiring segwit features.

This bumps the asset version to 1.  Note that we do not have a good
method for supporting multiple asset versions simultaneously, but
we can punt on that since LTC has not been deployed on mainnet
anywhere to my knowledge.

The client has asset version checks and will simply refuse an order if the server and client asset version does not match.

See discussion about possible client support for multiple asset versions here: #1054 (comment)


full, ok := btc.node.(*rpcClient)
if !ok {
return nil, fmt.Errorf("wallet backend not a *rpcClient: %T", btc.node)
Copy link
Member Author

Choose a reason for hiding this comment

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

could very well be a panic since this would be a grievous programmer error

@chappjc chappjc force-pushed the ltc-segwit branch 2 times, most recently from 77e9908 to 06e6259 Compare March 30, 2022 15:56
@chappjc
Copy link
Member Author

chappjc commented Mar 30, 2022

The litecoin testnet chain is completely stuck right now, but I tested this yesterday.

Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

LGTM. Inspired #1565 though.

client/asset/btc/btc.go Outdated Show resolved Hide resolved
if len(txData) == 0 {
// Fall back to gettxout, but we won't have the tx to rebroadcast.
pkScript, _ := btc.scriptHashScript(contract) // pkScript and since time are unused if full node
txOut, _, err = btc.node.getTxOut(txHash, vout, pkScript, time.Now().Add(-48*time.Hour))
Copy link
Member

Choose a reason for hiding this comment

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

I almost want the 48 hours to be configurable.

Copy link
Member Author

Choose a reason for hiding this comment

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

These two comments are for #1553, which this PR is stacked on. Will make the changes there.

Copy link
Member Author

@chappjc chappjc Apr 6, 2022

Choose a reason for hiding this comment

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

@buck54321 As a half measure, I made this an exported var so such oddball use cases (recovery tools and tests) can at least adjust the limit. I think if we want this used more commonly, we could go the route of adding a GetTxData/GetContractTxOut method as mentioned in the comments, and that could have this since time as an arg, but if we only can self-acquire a txout, not the whole txdata, I'm not sure how that would work.

@chappjc chappjc force-pushed the ltc-segwit branch 2 times, most recently from 495eee9 to aa48805 Compare April 6, 2022 16:00
This switches the LTC code to using and requiring segwit features.

This bumps the asset version to 1.  Note that we do not have a good
method for supporting multiple asset versions simultaneously, but
we can punt on that since LTC has not been deployed on mainnet
anywhere to my knowledge.
@chappjc chappjc merged commit 5ec2734 into decred:master Apr 6, 2022
@chappjc chappjc deleted the ltc-segwit branch April 6, 2022 20:43
@chappjc chappjc added this to the 0.4.3 milestone Apr 12, 2022
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.

3 participants