aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-02-03 19:13:28 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2017-06-05 23:14:34 +0000
commitb005bf21a7cabe827ef62f266c22adf2ee745b61 (patch)
treeb5c1181a3e3300eeaf458c0b588510700bf50e69 /src/rpc/rawtransaction.cpp
parent575cde4605c9a321ad591dbb7d632dd0ef946d40 (diff)
Introduce MAX_BIP125_RBF_SEQUENCE constant
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r--src/rpc/rawtransaction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 07a7ef34e2..332dbc08a3 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -14,6 +14,7 @@
#include "merkleblock.h"
#include "net.h"
#include "policy/policy.h"
+#include "policy/rbf.h"
#include "primitives/transaction.h"
#include "rpc/server.h"
#include "script/script.h"
@@ -359,7 +360,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
uint32_t nSequence;
if (rbfOptIn) {
- nSequence = std::numeric_limits<uint32_t>::max() - 2;
+ nSequence = MAX_BIP125_RBF_SEQUENCE;
} else if (rawTx.nLockTime) {
nSequence = std::numeric_limits<uint32_t>::max() - 1;
} else {
@@ -372,7 +373,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
int64_t seqNr64 = sequenceObj.get_int64();
if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, sequence number is out of range");
- } else if (seqNr64 <= std::numeric_limits<uint32_t>::max() - 2 && request.params.size() > 3 && request.params[3].isFalse()) {
+ } else if (seqNr64 <= MAX_BIP125_RBF_SEQUENCE && request.params.size() > 3 && request.params[3].isFalse()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter combination: Sequence number contradicts optintorbf option");
} else {
nSequence = (uint32_t)seqNr64;