channeldb: don't read/write funding transactions if a restore channel

This commit is contained in:
Olaoluwa Osuntokun committed 2019-03-28 17:53:43 -07:00
1 parent 19ef4bbcb9
commit 64b8facf0e
1 file changed
+6 -2
+6 -2
View File
@@ -2425,7 +2425,9 @@ func putChanInfo(chanBucket *bbolt.Bucket, channel *OpenChannel) error {
}
// For single funder channels that we initiated, write the funding txn.
if channel.ChanType == SingleFunder && channel.IsInitiator {
if channel.ChanType == SingleFunder && channel.IsInitiator &&
!channel.hasChanStatus(ChanStatusRestored) {
if err := WriteElement(&w, channel.FundingTxn); err != nil {
return err
}
@@ -2545,7 +2547,9 @@ func fetchChanInfo(chanBucket *bbolt.Bucket, channel *OpenChannel) error {
}
// For single funder channels that we initiated, read the funding txn.
if channel.ChanType == SingleFunder && channel.IsInitiator {
if channel.ChanType == SingleFunder && channel.IsInitiator &&
!channel.hasChanStatus(ChanStatusRestored) {
if err := ReadElement(r, &channel.FundingTxn); err != nil {
return err
}