Bitcoin Forum
May 08, 2024, 03:45:40 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why node is showing "whitelisted":false, even i added whitelist=<ip>  (Read 577 times)
btctousd81 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


View Profile WWW
September 14, 2017, 01:42:50 PM
Last edit: September 14, 2017, 01:53:23 PM by btctousd81
 #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

1715139940
Hero Member
*
Offline Offline

Posts: 1715139940

View Profile Personal Message (Offline)

Ignore
1715139940
Reply with quote  #2

1715139940
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715139940
Hero Member
*
Offline Offline

Posts: 1715139940

View Profile Personal Message (Offline)

Ignore
1715139940
Reply with quote  #2

1715139940
Report to moderator
1715139940
Hero Member
*
Offline Offline

Posts: 1715139940

View Profile Personal Message (Offline)

Ignore
1715139940
Reply with quote  #2

1715139940
Report to moderator
paraboul
Newbie
*
Offline Offline

Activity: 29
Merit: 0


View Profile WWW
September 17, 2017, 08:00:49 PM
Last edit: September 17, 2017, 08:23:38 PM by paraboul
 #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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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: 29
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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!