Merge pull request #1657 from cfromknecht/resend-ann-copy-key

discovery/gossiper: copy bolt key to prevent panic
This commit is contained in:
Johan T. Halseth 2018-07-31 08:26:23 +02:00 committed by GitHub
commit c48ecb85f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -796,7 +796,13 @@ func (d *AuthenticatedGossiper) resendAnnounceSignatures() error {
if err != nil { if err != nil {
return err return err
} }
t := msgTuple{peer, msg, k}
// Make a copy of the database key corresponding to
// these AnnounceSignatures.
dbKey := make([]byte, len(k))
copy(dbKey, k)
t := msgTuple{peer, msg, dbKey}
// Add the message to the slice, such that we can // Add the message to the slice, such that we can
// resend it after the database transaction is over. // resend it after the database transaction is over.