Three minor cleanups:
- Simplify
bool x = y ? true : falsetobool x = y - Remove unused function
InsecureRandBytes(size_t len) - Remove accidental trailing semicolon
Three minor cleanups:
bool x = y ? true : false to bool x = yInsecureRandBytes(size_t len)utACK a65124bc44515c60e13e74ec83f6adbb8cc48a68
utACK a65124b
utACK a65124b
211 | @@ -212,8 +212,8 @@ UniValue validateaddress(const JSONRPCRequest& request) 212 | 213 | #ifdef ENABLE_WALLET 214 | isminetype mine = pwallet ? IsMine(*pwallet, dest) : ISMINE_NO; 215 | - ret.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); 216 | - ret.push_back(Pair("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true: false)); 217 | + ret.push_back(Pair("ismine", static_cast<bool>(mine & ISMINE_SPENDABLE)));
Wouldn't simply bool(mine & ISMINE_SPENDABLE) work? I don't think we really want to re-interpret the value as a bool here, but instantiate a bool with the value !=0. I know static_cast doesn't reinterpret values, but it seems ugly...
Speaking of which, this could even be (mine & ISMINE_SPENDABLE) != 0?
@laanwj Good point! Now using the suggested bool(mine & ISMINE_SPENDABLE) form.
utACK 67ca816849d0aa292a138e6c08edafd17ad6a948