lnwallet/wallet: store funding txn during reservation

This commit is contained in:
Conner Fromknecht 2018-03-10 17:28:17 -08:00
parent db88c82169
commit 2e1dcd316c
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -1073,10 +1073,12 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
res.partialState.LocalChanCfg = res.ourContribution.toChanConfig() res.partialState.LocalChanCfg = res.ourContribution.toChanConfig()
res.partialState.RemoteChanCfg = res.theirContribution.toChanConfig() res.partialState.RemoteChanCfg = res.theirContribution.toChanConfig()
// We'll also record the finalized funding txn, which will allow us to
// rebroadcast on startup in case we fail.
res.partialState.FundingTxn = fundingTx
// Add the complete funding transaction to the DB, in its open bucket // Add the complete funding transaction to the DB, in its open bucket
// which will be used for the lifetime of this channel. // which will be used for the lifetime of this channel.
// TODO(roasbeef):
// * attempt to retransmit funding transactions on re-start
nodeAddr := res.nodeAddr nodeAddr := res.nodeAddr
err = res.partialState.SyncPending(nodeAddr, uint32(bestHeight)) err = res.partialState.SyncPending(nodeAddr, uint32(bestHeight))
if err != nil { if err != nil {