mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 22:42:04 +01:00
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.
This commit is contained in:
parent
fa2cc5d1d6
commit
fa0153e609
1 changed files with 2 additions and 2 deletions
|
@ -304,7 +304,7 @@ static RPCHelpMan createrawtransaction()
|
|||
|
||||
std::optional<bool> rbf;
|
||||
if (!request.params[3].isNull()) {
|
||||
rbf = request.params[3].isTrue();
|
||||
rbf = request.params[3].get_bool();
|
||||
}
|
||||
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
|
||||
|
||||
|
@ -1449,7 +1449,7 @@ static RPCHelpMan createpsbt()
|
|||
|
||||
std::optional<bool> rbf;
|
||||
if (!request.params[3].isNull()) {
|
||||
rbf = request.params[3].isTrue();
|
||||
rbf = request.params[3].get_bool();
|
||||
}
|
||||
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue