mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
4ee862e3be
This commit fixes a heap escape found in `GetBlock`. This happens because the `msgBlock` is a pointer returned from `getBlockImpl`, and the whole `getBlockImpl` escapes to the heap because it's referenced in two places, - in the `Cache`, it's used as a reference type to create the new block. - this pointer is also returned and now needs to stay on the heap. The fix is simple, we now make a copy of the block and use the copy instead, freeing `getBlockImpl` from the heap. |
||
---|---|---|
.. | ||
blockcache_test.go | ||
blockcache.go |