Skip to content

Commit fa0153e

Browse files
author
MarcoFalke
committed
refactor: Replace isTrue with get_bool
This makes the code more robust, see previous commit. In general replacing isTrue with get_bool is not equivalent because get_bool can throw exceptions, but in this case, exceptions won't happen because of RPCTypeCheck() and isNull() checks in the preceding code.
1 parent fa2cc5d commit fa0153e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static RPCHelpMan createrawtransaction()
304304

305305
std::optional<bool> rbf;
306306
if (!request.params[3].isNull()) {
307-
rbf = request.params[3].isTrue();
307+
rbf = request.params[3].get_bool();
308308
}
309309
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
310310

@@ -1449,7 +1449,7 @@ static RPCHelpMan createpsbt()
14491449

14501450
std::optional<bool> rbf;
14511451
if (!request.params[3].isNull()) {
1452-
rbf = request.params[3].isTrue();
1452+
rbf = request.params[3].get_bool();
14531453
}
14541454
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
14551455

0 commit comments

Comments
 (0)