Title: Why node is showing "whitelisted":false, even i added whitelist=<ip> Post by: btctousd81 on September 14, 2017, 01:42:50 PM 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> when i do Code: bitcoin-cli getpeerinfo Code: { see above it shows Code: "whitelisted": false, 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) both of them are defaults to 1 i.e. on.-whitelistforcerelay Force relay of transactions from whitelisted peers even if they violate local relay policy (default: 1) so what is causing this ? thanks Title: Re: Why node is showing "whitelisted":false, even i added whitelist=<ip> Post by: paraboul on September 17, 2017, 08:00:49 PM 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 Title: Re: Why node is showing "whitelisted":false, even i added whitelist=<ip> Post by: btctousd81 on September 18, 2017, 03:42:59 AM 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 Title: Re: Why node is showing "whitelisted":false, even i added whitelist=<ip> Post by: paraboul on September 18, 2017, 06:03:46 AM 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. |