Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index 332abc4..e3ed7be 100644
--- a/src/policy/policy.cpp
+++ b/src/policy/policy.cpp
@@ -55,7 +55,7 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType)
bool IsStandardTx(const CTransaction& tx, std::string& reason)
{
- if (tx.nVersion > CTransaction::CURRENT_VERSION || tx.nVersion < 1) {
+ if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) {
@btcdrak
btcdrak / sendalert.cpp
Created March 20, 2016 17:55 — forked from laanwj/sendalert.cpp
Bitcoin send alert code
/*
So you need to broadcast an alert...
... here's what to do:
1. Copy sendalert.cpp into your bitcoind build directory
2. Decrypt the alert keys
copy the decrypted file as alertkeys.h into the src/ directory.
3. Modify the alert parameters in sendalert.cpp
diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py
index 19ee472..3b08cd1 100755
--- a/qa/rpc-tests/test_framework/test_framework.py
+++ b/qa/rpc-tests/test_framework/test_framework.py
@@ -142,6 +142,9 @@ class BitcoinTestFramework(object):
except AssertionError as e:
print("Assertion failed: "+ str(e))
traceback.print_tb(sys.exc_info()[2])
+ except KeyError as e:
+ print("key not found: "+ str(e))
@btcdrak
btcdrak / sign.sh
Created May 3, 2016 18:21 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
test/txvalidationcache_tests.cpp(64): error in "tx_mempool_block_doublespend": check ToMemPool(spends[0]) failed
test/txvalidationcache_tests.cpp(70): error in "tx_mempool_block_doublespend": check ToMemPool(spends[1]) failed
test/txvalidationcache_tests.cpp(78): error in "tx_mempool_block_doublespend": check ToMemPool(spends[1]) failed
@btcdrak
btcdrak / gpg-offline-master.md
Created August 31, 2016 20:06 — forked from abeluck/gpg-offline-master.md
GPG Offline Master Key w/ smartcard
@btcdrak
btcdrak / yubitouch.sh
Created September 1, 2016 13:08 — forked from a-dma/yubitouch.sh
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
#!/bin/bash
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
#
# Author: Alessio Di Mauro <alessio@yubico.com>
GCA=$(which gpg-connect-agent)
DO=0
UIF=0
@btcdrak
btcdrak / openpgp-card-guide.md
Created September 1, 2016 21:31 — forked from ageis/openpgp-card-guide.md
Quick GPG Smartcard Guide

Quick GPG Smartcard Guide

We will generate a master key with only the Certify capability and three subkeys with each of the Sign, Encrypt and Authenticate capabilities. These latter three keys are meant for daily use and will be transferred to an OpenPGP smartcard, which has three corresponding slots. The master private key can then be moved to offline cold storage, or stored on a second smartcard.

We are generating keys on a secure computer instead of on the card, because it allows more flexibility. Ideally this means a machine running Tails or one that is air-gapped and not connected to the internet.

This guide assumes that if you want to sign other peoples keys, then you will require the aforementioned secondary smartcard with your master key stored in its Signature slot, or if you only have one smartcard, then you'll have to fetch the master key out of cold storage. By default, GPG generates a master key with the Certify and

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFfJ8J8BEADFqS5Xda1L51ntH2NAyQuvdt/kIib0dnt/e06wuoFjBXV1MRG+
WOCaX4fMqN8LPry9GM+0CbqHYTkWjqD58MzgqgcmnZwwliHI7DHxw3+76eYxoF+J
S5ln1C6XnBJd6LNp4crfKwCd6SAzt5m94YIutABkQbnEZlOpSdc6H7A+4boToZus
hrrHc1PMfzwGHIdU3Hcge9gWiB2wWI4lbN0Qqyb3FXD1U6a5LOBsiw2+aiuivHHo
it+HcoewLHd2F0BBLMygAOCsjJhnuX2T3Yf0cHJIKyOF2U/KrEPNYH02AMe26BaW
/3x9uX14BkIgXSvUXYeX+utsiRp8ozuKqvn5BumjBG6Br7wFspJnZSbRxxiXOlAa
FxqwjB/Z6v8wKazS7hhAI/hSCbEi8VwPvccbTnIG8FG9vADMbt+FRp6uZSnPIgDh