aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
-rw-r--r--src/rpcrawtransaction.cpp1
-rw-r--r--src/wallet/rpcwallet.cpp5
3 files changed, 6 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fb529eb5b6..9fca183bb0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3867,8 +3867,9 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
}
}
// disconnect node in case we have reached the outbound limit for serving historical blocks
+ // never disconnect whitelisted nodes
static const int nOneWeek = 7 * 24 * 60 * 60; // assume > 1 week = historical
- if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || inv.type == MSG_FILTERED_BLOCK) )
+ if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || inv.type == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted)
{
LogPrint("net", "historical block serving limit reached, disconnect peer=%d\n", pfrom->GetId());
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index 11d9a6f2bb..3bda459245 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -506,7 +506,6 @@ UniValue decodescript(const UniValue& params, bool fHelp)
+ HelpExampleRpc("decodescript", "\"hexstring\"")
);
- LOCK(cs_main);
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
UniValue r(UniValue::VOBJ);
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index d93050d98c..7b7c9b3256 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2418,9 +2418,12 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
if (!DecodeHexTx(origTx, params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
+ if (origTx.vout.size() == 0)
+ throw JSONRPCError(RPC_INVALID_PARAMETER, "TX must have at least one output");
+
bool includeWatching = false;
if (params.size() > 1)
- includeWatching = true;
+ includeWatching = params[1].get_bool();
CMutableTransaction tx(origTx);
CAmount nFee;