-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[WIP] funding: add publisher #6400
base: master
Are you sure you want to change the base?
Conversation
cc @yyforyongyu & @Crypt-iQ : looking for some approach comments before continuing. Pls see description :) |
This seems like a bug? |
Overall looks good.
There's another place we call
Wonder what these checks are. Are they ln-specific or bitcoin-specific? Do we have similar checks in |
I'm guessing this is the lite version of bitcoin transaction standardness - I think PublishTransaction calls it
why not abort if the tx is non-standard? if the mempool accept API fails due to ancestor limits / is full, we should probably keep the channel. AFAIK the only way to get tx standardness in bitcoind without broadcasting the transaction is to call the mempool accept API - maybe there's another RPC though. |
|
||
// calcPastMedianTime calculates the median time of the previous few blocks | ||
// prior to, and including, the block node. | ||
func calcPastMedianTime(chain chain.Interface) (time.Time, error) { |
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 dont think this should be copied
roasbeef said the locks are persisted and don't need to be re-acquired on startup, so this actually seems like correct behavior? |
@ellemouton, remember to re-request review from reviewers when ready |
closing for the time being as im not actively working on this |
Re-opening as related to #7868. I think push the branch to |
done! |
Fixes #4760
Fixes #386
Fixes #7868
The publisher does a few tx checks (sanity, standard, mempool test (not implemented yet)) before actually attempting to publish the transaction. Errors from each call is wrapped so that it is easy to reason about for the caller.
Still a WIP. Looking for approach comments. The last commit is a bit messy but i will clean it up after approach ACK.
Context:
The funding manager calls
Publish
at 2 points:I think we need to manage make decisions differently for each of the above scenarios:
For this scenario: we can safety abort the process if:
When we abort, we should make sure to release the locks on the utxos.
In this scenario, we need to be a bit more careful because at this point we dont know if the tx has ever been published before. So in this case, we only abort if we get a sanity check error OR we get a ErrDoubleSpend error.
Scope?:
The following still needs to be done. Should any of these be included in this PR?
Depends on btcsuite/btcd#1840