Merge pull request #1635 from halseth/funding-broadcast-fail

Move funding tx broadcasting to Fundingmanager
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-08-09 20:04:30 -07:00
commit d64bb5921e
6 files changed
+307 -100

No files matched your search

+10
View File
@@ -427,6 +427,11 @@ func testDualFundingReservationWorkflow(miner *rpctest.Harness,
t.Fatalf("channel not detected as dual funder")
}
// Let Alice publish the funding transaction.
if err := alice.PublishTransaction(fundingTx); err != nil {
t.Fatalf("unable to publish funding tx: %v", err)
}
// Mine a single block, the funding transaction should be included
// within this block.
err = waitForMempoolTx(miner, &fundingSha)
@@ -843,6 +848,11 @@ func testSingleFunderReservationWorkflow(miner *rpctest.Harness,
channeldb.SingleFunder, bobChannels[0].ChanType)
}
// Let Alice publish the funding transaction.
if err := alice.PublishTransaction(fundingTx); err != nil {
t.Fatalf("unable to publish funding tx: %v", err)
}
// Mine a single block, the funding transaction should be included
// within this block.
err = waitForMempoolTx(miner, &fundingSha)
+5 -5
View File
@@ -434,11 +434,11 @@ func (r *ChannelReservation) OurSignatures() ([]*InputScript, []byte) {
// https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki.
// Additionally, verification is performed in order to ensure that the
// counterparty supplied a valid signature to our version of the commitment
// transaction. Once this method returns, caller's should then call
// .WaitForChannelOpen() which will block until the funding transaction obtains
// the configured number of confirmations. Once the method unblocks, a
// LightningChannel instance is returned, marking the channel available for
// updates.
// transaction. Once this method returns, caller's should broadcast the
// created funding transaction, then call .WaitForChannelOpen() which will
// block until the funding transaction obtains the configured number of
// confirmations. Once the method unblocks, a LightningChannel instance is
// returned, marking the channel available for updates.
func (r *ChannelReservation) CompleteReservation(fundingInputScripts []*InputScript,
commitmentSig []byte) (*channeldb.OpenChannel, error) {
-10
View File
@@ -1096,16 +1096,6 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
return
}
walletLog.Infof("Broadcasting funding tx for ChannelPoint(%v): %v",
res.partialState.FundingOutpoint, spew.Sdump(fundingTx))
// Broadcast the finalized funding transaction to the network.
if err := l.PublishTransaction(fundingTx); err != nil {
msg.err <- err
msg.completeChan <- nil
return
}
msg.completeChan <- res.partialState
msg.err <- nil
}