Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jonatack's full-sized avatar

Jon Atack jonatack

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jonatack on github.
  • I am jonatack (https://keybase.io/jonatack) on keybase.
  • I have a public key ASCaeU38EDbcgqP2Wb2r3yZfg1IlWpLxKk99zYCGoq9xbQo

To claim this, I am signing this object:

@jonatack
jonatack / bitcoin-fuzzing.md
Created April 12, 2019 14:11
bitcoin fuzzing
/bitcoin/src# $AFLPATH
/afl-2.52b: Is a directory

/bitcoin/src# $AFLOUT
/qa-assets/outputs: Is a directory

/bitcoin/src# $DIR_FUZZ_IN
/qa-assets/fuzz_seed_corpus: Is a directory
@jonatack
jonatack / bitcoin-test-pr-15750.md
Last active April 21, 2019 16:59
Manual test of bitcoin/bitcoin PR 15750

Manual tests of master (at 66ce95a) versus bitcoin/bitcoin#15750 (at b4338c1) compiling from source and launching src/bitcoind -deprecatedrpc=validateaddress:

(master)$ src/bitcoin-cli getaddressinfo 33wjMTPWcmF12zfQZ2ecuvQfpfZjgVQ4ag
{
  "address": "33wjMTPWcmF12zfQZ2ecuvQfpfZjgVQ4ag",
  "scriptPubKey": "a91418b8a89d71daba341f2ba4dac25ad08c7f91d72a87",
  "ismine": true,
  "solvable": true,
@jonatack
jonatack / bitcoin-pr-15943.md
Created May 15, 2019 11:37
bitcoin-pr-15943
(pr/15943)$ test/functional/test_runner.py rpc_uptime --coverage
Temporary test directory at /tmp/test_runner_₿_🏃_20190515_133545
Initializing coverage directory at /tmp/coveragehsj4pafy
Remaining jobs: [rpc_uptime.py]
1/1 - rpc_uptime.py passed, Duration: 1 s

TEST          | STATUS    | DURATION

rpc_uptime.py | ✓ Passed  | 1 s
~/projects/bitcoin/src ((HEAD detached at origin/pr/15996))$ bitcoin-cli -regtest help bumpfee
bumpfee "txid" ( options )
Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.
An opt-in RBF transaction with the given txid must be in the wallet.
The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist.
If `totalFee` (DEPRECATED) is given, adding inputs is not supported, so there must be a single change output that is big enough or it will fail.
All inputs in the original transaction will be included in the replacement transaction.
The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
By default, the new fee will be calculated automatically using estimatesmartfee.
~/projects/bitcoin/bitcoin (pr/16202)$ git diff
diff --git a/src/net.cpp b/src/net.cpp
index d5e74d928f..d7371d80df 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -596,6 +596,9 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete
if (i == mapRecvBytesPerMsgCmd.end())
i = mapRecvBytesPerMsgCmd.find(NET_MESSAGE_COMMAND_OTHER);
assert(i != mapRecvBytesPerMsgCmd.end());
+
@jonatack
jonatack / benchmark_building_a_hash.rb
Last active June 18, 2020 14:31
Benchmark building a Ruby hash: #each - #each_with_object - #reduce - Hash[map] - #map.zip(map).to_h - #reduce-merge
require 'benchmark/ips'
Benchmark.ips do |x|
Property = Struct.new(:name, :original_name)
PROPERTIES = [
Property.new("Clo", "Chloe" ),
Property.new("Jon", "Jonathan" ),
Property.new("Kris", "Kristin" ),
@jonatack
jonatack / bitcoin-core-pr-11413-review-notes.md
Last active June 25, 2020 07:12
Notes from reviewing Bitcoin Core PR #11413 "[wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option" by kallewoof

Notes from reviewing Bitcoin Core PR #11413

"[wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option" by @kallewoof

bitcoin/bitcoin#11413


src/wallet/rpcwallet.cpp

@jonatack
jonatack / private.xml
Last active January 4, 2021 22:59
Karabiner custom setting to use the correct shift keys and break bad typing habits. Drop this into your private.xml file using https://github.com/tekezo/Karabiner for Mac OS, click on "Reload XML", then click on "Use the correct shift keys" at the top of the Karabiner Change Key settings.
<item>
<name>Use the correct shift keys.</name>
<identifier>private.correct_shift_keys</identifier>
<autogen>--KeyToKey-- KeyCode::BACKQUOTE, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::1, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::2, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::3, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::4, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>