diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2022-12-05 14:55:32 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2022-12-07 17:56:49 +0100 |
commit | fa0153e609caf61a59efb0779e754861edc1684d (patch) | |
tree | b005cbaf6e40a36f034fc5c713e540ebaf486833 /src/rpc | |
parent | fa2cc5d1d66aa00e828d1bb65b9923f76fbdf4e1 (diff) | |
download | bitcoin-fa0153e609caf61a59efb0779e754861edc1684d.tar.xz |
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.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index d654de1862..400f2f1507 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -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); |