Bitcoin Forum
October 17, 2018, 09:01:21 AM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Why node is showing "whitelisted":false, even i added whitelist=<ip>  (Read 413 times)
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 14, 2017, 01:42:50 PM
 #1

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=<ip>
whitelist=<ip>
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": "<ip>",
    "addrbind": "<myip>:<myport>",
    "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

1539766881
Hero Member
*
Offline Offline

Posts: 1539766881

View Profile Personal Message (Offline)

Ignore
1539766881
Reply with quote  #2

1539766881
Report to moderator
1539766881
Hero Member
*
Offline Offline

Posts: 1539766881

View Profile Personal Message (Offline)

Ignore
1539766881
Reply with quote  #2

1539766881
Report to moderator
1539766881
Hero Member
*
Offline Offline

Posts: 1539766881

View Profile Personal Message (Offline)

Ignore
1539766881
Reply with quote  #2

1539766881
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1539766881
Hero Member
*
Offline Offline

Posts: 1539766881

View Profile Personal Message (Offline)

Ignore
1539766881
Reply with quote  #2

1539766881
Report to moderator
paraboul
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile WWW
September 17, 2017, 08:00:49 PM
 #2

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
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 18, 2017, 03:42:59 AM
 #3

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=<IP address or network>   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

paraboul
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile WWW
September 18, 2017, 06:03:46 AM
 #4

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=<IP address or network>   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.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!