mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-15 19:55:51 +00:00
PeerGroup: stall handling tweak: specify default bandwidth requirement in terms of block headers per second and make much lower, to avoid having false stalls when the Bloom FP rate is lowered (and thus bandwidth required is much lower). It's unclear how useful stall handling will be after this change, but we'll experiment with it a bit and find out.
This commit is contained in:
parent
82a0ddd4de
commit
dd453ca677
@ -1474,7 +1474,7 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
}
|
||||
|
||||
@GuardedBy("lock") private int stallPeriodSeconds = 10;
|
||||
@GuardedBy("lock") private int stallMinSpeed = 30;
|
||||
@GuardedBy("lock") private int stallMinSpeedBytesSec = Block.HEADER_SIZE * 20;
|
||||
|
||||
/**
|
||||
* Configures the stall speed: the speed at which a peer is considered to be serving us the block chain
|
||||
@ -1485,13 +1485,13 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
* avoid false stalls.
|
||||
*
|
||||
* @param periodSecs How many seconds the download speed must be below blocksPerSec, defaults to 10.
|
||||
* @param kilobytesPerSecond Download speed (only blocks/txns count) must be consistently below this for a stall, defaults to 30.
|
||||
* @param bytesPerSecond Download speed (only blocks/txns count) must be consistently below this for a stall, defaults to the bandwidth required for 20 block headers per second.
|
||||
*/
|
||||
public void setStallThreshold(int periodSecs, int kilobytesPerSecond) {
|
||||
public void setStallThreshold(int periodSecs, int bytesPerSecond) {
|
||||
lock.lock();
|
||||
try {
|
||||
stallPeriodSeconds = periodSecs;
|
||||
stallMinSpeed = kilobytesPerSecond;
|
||||
stallMinSpeedBytesSec = bytesPerSecond;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
@ -1546,7 +1546,7 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
|
||||
lock.lock();
|
||||
try {
|
||||
minSpeedBytesPerSec = stallMinSpeed * 1024;
|
||||
minSpeedBytesPerSec = stallMinSpeedBytesSec;
|
||||
period = stallPeriodSeconds;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user