Author

Topic: Why node is showing "whitelisted":false, even i added whitelist=<ip> (Read 580 times)

newbie
Activity: 29
Merit: 0
You can try to specify the address on which whitelisted node can connect to, using "-whitebind".

If you look closely, the value you're refering to is displayed here : https://github.com/bitcoin/bitcoin/blob/e0e3cbbf081b74ed5322176dcda081c64076fd21/src/rpc/net.cpp#L171

This value is set here :

https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L1056

Code:
bool whitelisted = hListenSocket.whitelisted || IsWhitelistedRange(addr);

So, it's true either because it's connected to a whitelisted bound address (set by -whitebind and should be restricted by a firewall or local network) or is in the whitelist range (which you seem to (wrongly?) set in your config).

I suggest you to break into this code and check what's going wrong with the test against the addr in your config : https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L607-L613

thank you , looking in to it.

wiki says i can specify ip too. and not just ip range.

-whitelist=   Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times. Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway


and i have other non trusted peers connecting to my node.
so if i do whitebind., then all the nodes will be whitlisted , i dont think thats a good idea.

ill try , the whitelist with cidr range.

thnks

That's what I said actually, hence my statement about adding a breakpoint into the IsWhitelistedRange() function (which check against the IP specified in the whitelist config key).
I suggested you to try whitebind as a test to make sure that your config is working properly.
sr. member
Activity: 434
Merit: 270
You can try to specify the address on which whitelisted node can connect to, using "-whitebind".

If you look closely, the value you're refering to is displayed here : https://github.com/bitcoin/bitcoin/blob/e0e3cbbf081b74ed5322176dcda081c64076fd21/src/rpc/net.cpp#L171

This value is set here :

https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L1056

Code:
bool whitelisted = hListenSocket.whitelisted || IsWhitelistedRange(addr);

So, it's true either because it's connected to a whitelisted bound address (set by -whitebind and should be restricted by a firewall or local network) or is in the whitelist range (which you seem to (wrongly?) set in your config).

I suggest you to break into this code and check what's going wrong with the test against the addr in your config : https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L607-L613

thank you , looking in to it.

wiki says i can specify ip too. and not just ip range.

-whitelist=   Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times. Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway


and i have other non trusted peers connecting to my node.
so if i do whitebind., then all the nodes will be whitlisted , i dont think thats a good idea.

ill try , the whitelist with cidr range.

thnks
newbie
Activity: 29
Merit: 0
You can try to specify the address on which whitelisted node can connect to, using "-whitebind".

If you look closely, the value you're refering to is displayed here : https://github.com/bitcoin/bitcoin/blob/e0e3cbbf081b74ed5322176dcda081c64076fd21/src/rpc/net.cpp#L171

This value is set here :

https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L1056

Code:
bool whitelisted = hListenSocket.whitelisted || IsWhitelistedRange(addr);

So, it's true either because it's connected to a whitelisted bound address (set by -whitebind and should be restricted by a firewall or local network) or is in the whitelist range (which you seem to (wrongly?) set in your config).

I suggest you to break into this code and check what's going wrong with the test against the addr in your config : https://github.com/bitcoin/bitcoin/blob/723e5806578be90ba0f6b953629cf7389e6a27cd/src/net.cpp#L607-L613
sr. member
Activity: 434
Merit: 270
i am trying to add relay nodes. which will relay my transactions to their peers.

i have added them specifically in my bitcoin.conf file

Code:
addnode=
whitelist=
when i start bitcoin, i can see they are being added in the bitcoind.
when i do
Code:
bitcoin-cli getpeerinfo
i get this

Code:
  {
    "id": 1,
    "addr": "",
    "addrbind": ":",
    "services": "0000000000000001",
    "relaytxes": true,
    "lastsend": 1505396154,
    "lastrecv": 1505396157,
    "bytessent": 2486374,
    "bytesrecv": 8588359,
    "conntime": 1505379187,
    "timeoffset": 0,
    "pingtime": 0.035034,
    "minping": 0.034549,
    "version": 70014,
    "subver": "/Satoshi:0.14.2/UASF-Segwit:1.0(BIP148)/",
    "inbound": false,
    "addnode": true,
    "startingheight": 485189,
    "banscore": 11700,
    "synced_headers": 485220,
    "synced_blocks": 485189,
    "inflight": [
    ],
    "whitelisted": false,
    "bytessent_per_msg": {
      "addr": 7225,
      "blocktxn": 53866,
      "cmpctblock": 238678,
      "feefilter": 32,
      "getaddr": 24,
      "getdata": 616729,
      "getheaders": 1021,
      "inv": 181292,
      "ping": 4544,
      "reject": 127148,
      "sendcmpct": 66,
      "sendheaders": 24,
      "tx": 1255574,
      "verack": 24,
      "version": 127
    },
    "bytesrecv_per_msg": {
      "addr": 25,
      "block": 4038,
      "cmpctblock": 100094,
      "getblocktxn": 452,
      "getdata": 107726,
      "headers": 106,
      "inv": 3699833,
      "notfound": 38558,
      "pong": 4544,
      "sendcmpct": 33,
      "tx": 4632787,
      "verack": 24,
      "version": 139
    }
  }

see above it shows    

Code:
 "whitelisted": false,
why is that ?

how can i make sure., i accept and relat tx from that node ?

thanks

how can i make it whitelisted : true


-------------------------------------------------------------------------------------------------------------------------
edit1 :

from https://en.bitcoin.it/wiki/Running_Bitcoin

Quote
-whitelistrelay   Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: 1)
-whitelistforcerelay   Force relay of transactions from whitelisted peers even if they violate local relay policy (default: 1)
both of them are defaults to 1 i.e. on.
so what is causing this ?

thanks
Jump to: