Skip to content

Instantly share code, notes, and snippets.

Rusty Russell rustyrussell

Block or report user

Report or block rustyrussell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dijkstra-hard-limit.patch
diff --git a/gossipd/gossip_wire.csv b/gossipd/gossip_wire.csv
index 63392d87b..7b36f9831 100644
--- a/gossipd/gossip_wire.csv
+++ b/gossipd/gossip_wire.csv
@@ -37,6 +37,7 @@ msgdata,gossip_getroute_request,fuzz,double,
msgdata,gossip_getroute_request,num_excluded,u16,
msgdata,gossip_getroute_request,excluded,short_channel_id_dir,num_excluded
msgdata,gossip_getroute_request,max_hops,u32,
+msgdata,gossip_getroute_request,hard_limit,bool,
View genaddress.c
#include "../lightning/external/libwally-core/include/wally_address.h"
#include "../lightning/external/libwally-core/include/wally_bip32.h"
#include "../lightning/external/libwally-core/src/secp256k1/include/secp256k1.h"
#include "../lightning/common/bech32.c"
#include <ccan/crypto/sha256/sha256.h>
#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/str/hex/hex.h>
#include <err.h>
#include <assert.h>
#include <stdio.h>
@rustyrussell
rustyrussell / build-release.sh
Created Oct 26, 2018
Release script for c-lightning
View build-release.sh
#! /bin/sh
set -e
if [ "$(git status --porcelain -u no)" != "" ]; then
echo "Not a clean git directory" >&2
exit 1
fi
VERSION=`git tag --points-at HEAD`
if [ "$VERSION" = "" ]; then
@rustyrussell
rustyrussell / Bbock.hex
Created Jul 4, 2018
bitcoin-cli getblock 0000000000000000000fda35b2a2a3e24009d64f043c9f0370825a7193667232 false
View Bbock.hex
This file has been truncated, but you can view the full file.
@rustyrussell
rustyrussell / siphash-route-bench.patch
Created Feb 23, 2018
Unfinished patch for switching from isaac to siphash...
View siphash-route-bench.patch
diff --git a/gossipd/routing.c b/gossipd/routing.c
index 69db3001..5798c239 100644
--- a/gossipd/routing.c
+++ b/gossipd/routing.c
@@ -5,7 +5,6 @@
#include <ccan/array_size/array_size.h>
#include <ccan/crypto/siphash24/siphash24.h>
#include <ccan/endian/endian.h>
-#include <ccan/isaac/isaac64.h>
#include <ccan/structeq/structeq.h>
View gist:4c32413c6daefc7b3cb1e25aab830c45
#define STRUCTEQ_SAFE(t, ...) \
static inline bool structeq_##t(const struct t *a, const struct t *b) \
{ \
return CPPMAGIC_JOIN(&&, STRUCTEQ_MAP2(STRUCTEQ_MEMBEREQ_, t, __VA_ARGS__)); \
}
#define STRUCTEQ_MEMBEREQ_(t, m) \
(memcmp(&a->m, &b->m, sizeof(a->m)) == 0)
/* Stolen from cppmagic, but with a extra arg added. */
@rustyrussell
rustyrussell / ping-revision.diff
Created Mar 31, 2017
Suggested update for PR#134
View ping-revision.diff
commit 108869b8cdfa33c4ae4b842e990047b6b1e805a2
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Fri Mar 31 13:21:35 2017 +1030
UPDATES:
1. rename randombytes to ignored, and say they SHOULD BE zero. Simpler.
2. Add explicit padding field to `ping`: that keeps it extensible.
3. Split requirements into sender and receiver; they're kind of intertwined
so let's combine the two sections.
View hkdf-clarification.patch
diff --git a/08-transport.md b/08-transport.md
index d8edcf6..72fb64a 100644
--- a/08-transport.md
+++ b/08-transport.md
@@ -130,7 +130,7 @@ The following functions will also be referenced:
* The returned value is the raw big-endian byte serialization of
`x-coordinate` (using affine coordinates) of the generated point.
- * `HKDF`: a function is defined in [5](#reference-5), evaluated with a
+ * `HKDF(salt,ikm)`: a function is defined in [5](#reference-5), evaluated with a
@rustyrussell
rustyrussell / next-block-fees.sh
Last active Nov 24, 2016
What I'm watching right now... #bitcoin
View next-block-fees.sh
# Assumes you've set blockmaxweight=4000000 and blocksizemax=1000000 in bitcoin.conf
# Every 10 seconds, prints out: <blocknum>:<satoshis-in-fees-nextblock>(<fees-in-USD)=<percent-of-subsidy>,
# eg:
# 440303:123401888($911.692)=9%
# 440304:62908635($464.768)=5%
# 440305:63134415($466.436)=5%
# 440305:63317722($467.791)=5%
i=0
View keybase.md

Keybase proof

I hereby claim:

  • I am rustyrussell on github.
  • I am rusty (https://keybase.io/rusty) on keybase.
  • I have a public key ASC4VX3VeiYZQYlueN8xKP66plAc-FBIXx8HWn8lCOAU7Ao

To claim this, I am signing this object:

You can’t perform that action at this time.