diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-09-02 17:03:27 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2015-10-26 15:37:30 +0100 |
commit | 872fee3fccc8b33b9af0a401b5f85ac5504b57eb (patch) | |
tree | d868b4a0a6b9f9b55882c324afb362d5a1914e20 /src/rpcnet.cpp | |
parent | 867d6c90b85070644c3458e3e7ed168765523361 (diff) |
Introduce -maxuploadtarget
* -maxuploadtarget can be set in MiB
* if <limit> - ( time-left-in-24h-cycle / 600 * MAX_BLOCK_SIZE ) has reach, stop serve blocks older than one week and filtered blocks
* no action if limit has reached, no guarantee that the target will not be surpassed
* add outbound limit informations to rpc getnettotals
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r-- | src/rpcnet.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 7746be25f7..6b4815ebd8 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -379,6 +379,15 @@ UniValue getnettotals(const UniValue& params, bool fHelp) obj.push_back(Pair("totalbytesrecv", CNode::GetTotalBytesRecv())); obj.push_back(Pair("totalbytessent", CNode::GetTotalBytesSent())); obj.push_back(Pair("timemillis", GetTimeMillis())); + + UniValue outboundLimit(UniValue::VOBJ); + outboundLimit.push_back(Pair("timeframe", CNode::GetMaxOutboundTimeframe())); + outboundLimit.push_back(Pair("target", CNode::GetMaxOutboundTarget())); + outboundLimit.push_back(Pair("target_reached", CNode::OutboundTargetReached(false))); + outboundLimit.push_back(Pair("serve_historical_blocks", !CNode::OutboundTargetReached(true))); + outboundLimit.push_back(Pair("bytes_left_in_cycle", CNode::GetOutboundTargetBytesLeft())); + outboundLimit.push_back(Pair("time_left_in_cycle", CNode::GetMaxOutboundTimeLeftInCycle())); + obj.push_back(Pair("uploadtarget", outboundLimit)); return obj; } |