channeldb: fix panic bug in channeldb, check proper bucket for nil-ness

This commit is contained in:
Olaoluwa Osuntokun 2017-05-10 16:37:50 -07:00
parent a18d9b8449
commit 373a1192ce
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
1 changed files with 2 additions and 2 deletions

View File

@ -561,7 +561,7 @@ func (c *OpenChannel) RevocationLogTail() (*ChannelDelta, error) {
}
logBucket := nodeChanBucket.Bucket(channelLogBucket)
if nodeChanBucket == nil {
if logBucket == nil {
return ErrNoPastDeltas
}
@ -635,7 +635,7 @@ func (c *OpenChannel) FindPreviousState(updateNum uint64) (*ChannelDelta, error)
}
logBucket := nodeChanBucket.Bucket(channelLogBucket)
if nodeChanBucket == nil {
if logBucket == nil {
return ErrNoPastDeltas
}