Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Vjxcw-0006Yn-KY for bitcoin-development@lists.sourceforge.net; Fri, 22 Nov 2013 20:46:58 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of bitpay.com designates 74.125.82.173 as permitted sender) client-ip=74.125.82.173; envelope-from=jgarzik@bitpay.com; helo=mail-we0-f173.google.com; Received: from mail-we0-f173.google.com ([74.125.82.173]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Vjxcv-0001Uk-DV for bitcoin-development@lists.sourceforge.net; Fri, 22 Nov 2013 20:46:58 +0000 Received: by mail-we0-f173.google.com with SMTP id t61so1657924wes.18 for ; Fri, 22 Nov 2013 12:46:51 -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=zm7flVfgVNQSlHafBdk1yBpN/bTrOsGGOd73/VMLcVw=; b=eWZFX4SW4ICI4jdezz4ZigZL+BkBSFLPDZ2JYrqOiwLT+wni2fP0yu9Nw9cXhk7etT VH8JsuZ/iRdOI8ZKimq96/TyrBx0suOva6hwL+rlWoT4tt8B5R0MQm6FC+ISrjNTPWhm bDcUR9Ui33CyavopmltB4EYpkjwXSJ0O/lRmdldc54fidjXl9CK9NQ+Wy4PzBaOe0cJr gUdcBNQjBi+R3JsRfcB4YCqid9IqwA8yKOuZ+jcME+o/YqHbQRBFEqcxxYRtG70i/2/V 66AYWULZ+ckTWwg8ILLfeLw/lY4PmxeH4TvssAwXuDgoC+OK67hXLE0Y3Fi7n2om2UuT pJQg== X-Gm-Message-State: ALoCoQlCCkb/D5VhdCnBUHmoLSpT2l7JrJbxbrhirrZFqQUHWmG1M7OHWTy2gmblYivyRvxJDnoa MIME-Version: 1.0 X-Received: by 10.194.9.100 with SMTP id y4mr11898186wja.22.1385153211057; Fri, 22 Nov 2013 12:46:51 -0800 (PST) Received: by 10.194.164.164 with HTTP; Fri, 22 Nov 2013 12:46:50 -0800 (PST) Date: Fri, 22 Nov 2013 15:46:50 -0500 Message-ID: From: Jeff Garzik To: Bitcoin Dev Content-Type: multipart/mixed; boundary=047d7b5d58a21aef2304ebca1df7 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: 1Vjxcv-0001Uk-DV Subject: [Bitcoin-development] [PATCH] bitcoind: whitelist nodes, to prevent them from being banned 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:46:58 -0000 --047d7b5d58a21aef2304ebca1df7 Content-Type: text/plain; charset=ISO-8859-1 Trying something new... a [simple] patch sent to the list, for discussion. Seems unlikely to be controversial. github access is temporarily disabled, so this is the best pull request avenue for the moment. -- Jeff Garzik Bitcoin core developer and open source evangelist BitPay, Inc. https://bitpay.com/ --047d7b5d58a21aef2304ebca1df7 Content-Type: text/plain; charset=US-ASCII; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hobweij50 ZGlmZiAtLWdpdCBhL25vZGVfbW9kdWxl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V0dXJuIHR4OworfQorCitmdW5jdGlvbiBsb2FkQ21kRmlsZShmaWxlbmFtZSkgewor CXZhciBkYXRhID0gSlNPTi5wYXJzZShmcy5yZWFkRmlsZVN5bmMoZmlsZW5hbWUpKS5yZXN1bHQ7 CisJcmV0dXJuIGRhdGE7Cit9CisKKy8vIGhvdyBtYW55IGNvcGllcyBvZiB0aGlzIGNhbiBvbmUg Y29kZWJhc2UgYmVhcj8KK2Z1bmN0aW9uIHRyYW5zYWN0aW9uRGVzYyh0eCkgeworICB2YXIgb3V0 RGVzY3JpcHRpb25zID0gW107CisgIHZhciBvdXRzID0gdHgub3V0czsKKyAgZm9yKHZhciBpPTA7 IGk8b3V0cy5sZW5ndGg7IGkrKykgeworICAgIHZhciB0eG91dCA9IG91dHNbaV07CisgICAgdmFy IHNjcmlwdCA9IHR4b3V0LmdldFNjcmlwdCgpOworICAgIHZhciB0eXBlID0gc2NyaXB0LmdldE91 dFR5cGUoKTsKKyAgICB2YXIgYW1vdW50ID0gKHR4b3V0LmdldFZhbHVlKCkgLyAxZTgpLnJvdW5k KDgpOworICAgIGlmKHR5cGUgPT0gJ0FkZHJlc3MnKSB7CisgICAgICBvdXREZXNjcmlwdGlvbnMu cHVzaCh7CisgICAgICAgIHR5cGU6IHR5cGUsCisgICAgICAgIGFtb3VudDogYW1vdW50LAorICAg ICAgICBhZGRyZXNzOiBVdGlsLnB1YktleUhhc2hUb0FkZHJlc3Moc2NyaXB0LnNpbXBsZU91dEhh c2goKSkKKyAgICAgIH0pOworICAgIH0gZWxzZSB7CisgICAgICBvdXREZXNjcmlwdGlvbnMucHVz aCh7CisgICAgICAgIHR5cGU6IHR5cGUsCisgICAgICAgIGFtb3VudDogYW1vdW50CisgICAgICB9 KTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIHsKKyAgICB0eGlkOiBVdGlsLmZvcm1hdEhhc2hGdWxs KHR4LmdldEhhc2goKSksCisgICAgb3V0czogb3V0RGVzY3JpcHRpb25zCisgIH0KK307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