aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-02-17 16:32:16 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2017-03-29 00:40:17 -0700
commitc21cbe61c6249bcfca098705df6f9b4baab9f296 (patch)
treeddc52711d82709261d7fdfb541dee9a5f7e76079 /src/random.h
parent4bd0e9b90a39c5c6a016b83882ae44cb4d28f1f8 (diff)
downloadbitcoin-c21cbe61c6249bcfca098705df6f9b4baab9f296.tar.xz
Introduce FastRandomContext::randbool()
Diffstat (limited to 'src/random.h')
-rw-r--r--src/random.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/random.h b/src/random.h
index 0464bdce14..82886bec59 100644
--- a/src/random.h
+++ b/src/random.h
@@ -42,6 +42,10 @@ public:
return (Rw << 16) + Rz;
}
+ bool randbool() {
+ return rand32() & 1;
+ }
+
uint32_t Rz;
uint32_t Rw;
};