Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Vjxf5-00048C-Qo for bitcoin-development@lists.sourceforge.net; Fri, 22 Nov 2013 20:49:11 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of bitpay.com designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; envelope-from=jgarzik@bitpay.com; helo=mail-wi0-f174.google.com; Received: from mail-wi0-f174.google.com ([209.85.212.174]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Vjxf4-0001Zp-KJ for bitcoin-development@lists.sourceforge.net; Fri, 22 Nov 2013 20:49:11 +0000 Received: by mail-wi0-f174.google.com with SMTP id ez12so1305732wid.7 for ; Fri, 22 Nov 2013 12:49:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=2I0v07O7+8sRDVzaRbyUgAYRJypjbzA7ihvxJN/av/A=; b=dsn9JgPsNtZa4KcR9zGSaOMVlJgWsRtt7kSQ58afFinDdSvf0H8vB36RmKwhCxqWeA s2Cjlw5EEq7xgNsGTmXOUyZGeB4LWUmYiS21RwV2yxykrD1jsDuIu99L8g5P+iSzqcOl Z5NWBvZ253om46L4Xd3ouslwhHHTDmc/tXWVgw78r+a+9HcQZHbZRLoRyQzZ4CouQYve GtTgw7dgfmt02cS3ClKBrFwuye85Oo0qS1lM+9/IhQFeXEo0gfPkqAY/Qpl2tGbv29hd fv6tBZdKp3I2CuCzKwOzCoXxE7/yzcB87VwnUmF3YzOrCkHJdouzbTYisQ+sJbNkOwoU 8Aeg== X-Gm-Message-State: ALoCoQn2ni3HFwzfAGHzxrgXAGz1ggLXiZh0TQn5R/mJMwHeeOpomr80Rac0p1D0DlyEj1VOV023 MIME-Version: 1.0 X-Received: by 10.194.89.233 with SMTP id br9mr11939666wjb.15.1385153344423; Fri, 22 Nov 2013 12:49:04 -0800 (PST) Received: by 10.194.164.164 with HTTP; Fri, 22 Nov 2013 12:49:04 -0800 (PST) Date: Fri, 22 Nov 2013 15:49:04 -0500 Message-ID: From: Jeff Garzik To: Bitcoin Dev Content-Type: multipart/mixed; boundary=089e0102fb5c0e160c04ebca253c X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: bitpay.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1Vjxf4-0001Zp-KJ Subject: [Bitcoin-development] [PATCH, try2] bitcoind: whitelist nodes against banning X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 20:49:12 -0000 --089e0102fb5c0e160c04ebca253c Content-Type: text/plain; charset=ISO-8859-1 Whitelist nodes against banning. -- Jeff Garzik Bitcoin core developer and open source evangelist BitPay, Inc. https://bitpay.com/ --089e0102fb5c0e160c04ebca253c Content-Type: text/plain; charset=US-ASCII; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hobwj2tc0 Y29tbWl0IGFmN2I2MjQ3NjNlNzkwMDc1ZjhiYjI5YTA4NDMwOWU2NTkxZTM0NjkKQXV0aG9yOiBK ZWZmIEdh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gIlwiMTkyLjE2OC4wLjY6ODMzM1wiICIp CisgICAgICAgICAgICArIEhlbHBFeGFtcGxlUnBjKCJhZGR3aGl0ZSIsICJcIjE5Mi4xNjguMC42 OjgzMzNcIiAiKQorICAgICAgICApOworCisgICAgc3RyaW5nIHN0ck5vZGUgPSBwYXJhbXNbMF0u Z2V0X3N0cigpOworCisgICAgQ1NlcnZpY2Ugc2VydihzdHJOb2RlLmNfc3RyKCksIFBhcmFtcygp LkdldERlZmF1bHRQb3J0KCksIHRydWUpOworCisgICAgcmV0dXJuIEFkZFdoaXRlbGlzdChzZXJ2 LCAwKTsKK30KKwogVmFsdWUgYWRkbm9kZShjb25zdCBBcnJheSYgcGFyYW1zLCBib29sIGZIZWxw KQogewogICAgIHN0cmluZyBzdHJDb21tYW5kOwo= --089e0102fb5c0e160c04ebca253c--