bitcoin/bitcoin — pull request #5239 by laanwj (2014-11-07 12:51:51+00:00)
Title: Make sure that GetRandomBytes never fails

The code uses GetRandomBytes in several contexts where it's either unwieldy to return an error, or an error would mean a fatal exception anyhow. Bitcoin can't cope gracefully with a failing RNG. So just fail with an assertion error.

@gmaxwell checked OpenSSL a while ago and discovered that it never actually fails, but it can't hurt to be a bit paranoid here.

(somehow this gives me a deja-vu, I remember we did this before? can't find it in git history though)