nochowderforyou / clams

Clam Project
MIT License
62 stars 58 forks source link

'getsupport' results inconsistent across clamd instances #270

Closed dooglus closed 8 years ago

dooglus commented 8 years ago

I ran the same command on three different servers and got three different results, even though the are looking at the same 'best chain':

$ clamd getsupport; clamd getblockhash $(clamd getblockcount)
{
  "threshold" : 0,
  "window" : 10000,
  "endblock" : 779782,
  "startblock" : 769783,
  "support" : {
    "0000cb61" : 55,
    "02fde4a4" : 51,
    "066b223d" : 12,
    "26dfbf81" : 18,
    "5afa074c" : 340,
    "694c26a6" : 63,
    "7a69a853" : 175,
    "c9328886" : 5,
    "e2ef93da" : 6,
    "ea06c089" : 158,
    "eff96b06" : 13,
    "ff839af9" : 258
  }
}
13fb92f0dcb8b952f9e08e97cfe0903c1f828281cb0bdb3c237ef1cac4b53880

$ clamd getsupport; clamd getblockhash $(clamd getblockcount)
{
  "threshold" : 0,
  "window" : 10000,
  "endblock" : 779782,
  "startblock" : 769783,
  "support" : {
    "0000cb61" : 57,
    "02fde4a4" : 52,
    "066b223d" : 13,
    "26dfbf81" : 19,
    "5afa074c" : 358,
    "694c26a6" : 58,
    "7a69a853" : 185,
    "c9328886" : 8,
    "deaddea1" : 2,
    "e2ef93da" : 8,
    "ea06c089" : 170,
    "eff96b06" : 14,
    "ff839af9" : 265
  }
}
13fb92f0dcb8b952f9e08e97cfe0903c1f828281cb0bdb3c237ef1cac4b53880

$ clamd getsupport; clamd getblockhash $(clamd getblockcount)
{
  "threshold" : 0,
  "window" : 10000,
  "endblock" : 779782,
  "startblock" : 769783,
  "support" : {
    "0000cb61" : 49,
    "02fde4a4" : 46,
    "066b223d" : 7,
    "26dfbf81" : 18,
    "5afa074c" : 307,
    "694c26a6" : 46,
    "7a69a853" : 148,
    "c9328886" : 5,
    "deaddea1" : 1,
    "e2ef93da" : 3,
    "ea06c089" : 143,
    "eff96b06" : 12,
    "ff839af9" : 217
  }
}
13fb92f0dcb8b952f9e08e97cfe0903c1f828281cb0bdb3c237ef1cac4b53880

I'll investigate.

dooglus commented 8 years ago

fSupportChecked isn't initialised to false in main.h, so sometimes it will already be true, and so votes will be missed.

dooglus commented 8 years ago

Now I'm getting consistent results:

$ clamd getsupport 0 10000 779782
{
  "threshold" : 0,
  "window" : 10000,
  "endblock" : 779782,
  "startblock" : 769783,
  "support" : {
    "0000cb61" : 59,
    "02fde4a4" : 64,
    "066b223d" : 14,
    "26dfbf81" : 19,
    "5afa074c" : 420,
    "694c26a6" : 74,
    "7a69a853" : 215,
    "c9328886" : 9,
    "deaddea1" : 2,
    "e2ef93da" : 8,
    "ea06c089" : 201,
    "eff96b06" : 14,
    "ff839af9" : 318
  }
}