-
Notifications
You must be signed in to change notification settings - Fork 102
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
ltc: switch to segwit #1554
Conversation
client/asset/btc/btc.go
Outdated
|
||
full, ok := btc.node.(*rpcClient) | ||
if !ok { | ||
return nil, fmt.Errorf("wallet backend not a *rpcClient: %T", btc.node) |
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.
could very well be a panic since this would be a grievous programmer error
77e9908
to
06e6259
Compare
The litecoin testnet chain is completely stuck right now, but I tested this yesterday. |
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.
LGTM. Inspired #1565 though.
client/asset/btc/btc.go
Outdated
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)) |
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.
I almost want the 48 hours to be configurable.
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.
These two comments are for #1553, which this PR is stacked on. Will make the changes 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.
@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.
495eee9
to
aa48805
Compare
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.
Rebased on #1553 so the "livetest" simnet test can actually succeed.
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)