Skip to content

Commit 94c0c9f

Browse files
committed
Merge branch 'v0.8'
2 parents 125a658 + aaa6fb1 commit 94c0c9f

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed

bitcoin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2012-2016 The python-bitcoinlib developers
1+
# Copyright (C) 2012-2017 The python-bitcoinlib developers
22
#
33
# This file is part of python-bitcoinlib.
44
#
@@ -16,7 +16,7 @@
1616
# Note that setup.py can break if __init__.py imports any external
1717
# dependencies, as these might not be installed when setup.py runs. In this
1818
# case __version__ could be moved to a separate version.py and imported here.
19-
__version__ = '0.7.1-SNAPSHOT'
19+
__version__ = '0.9.0-PENDING'
2020

2121
class MainParams(bitcoin.core.CoreMainParams):
2222
MESSAGE_START = b'\xf9\xbe\xb4\xd9'

bitcoin/core/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2012-2015 The python-bitcoinlib developers
1+
# Copyright (C) 2012-2017 The python-bitcoinlib developers
22
#
33
# This file is part of python-bitcoinlib.
44
#
@@ -486,10 +486,14 @@ def GetTxid(self):
486486
txid = Hash(self.serialize())
487487
return txid
488488

489+
# preserve GetHash so our AttributeError-raising stub works
490+
def __make_CMutableTransaction_mutable(cls):
491+
get_hash_fn = cls.GetHash
492+
cls = __make_mutable(cls)
493+
cls.GetHash = get_hash_fn
494+
return cls
489495

490-
491-
492-
@__make_mutable
496+
@__make_CMutableTransaction_mutable
493497
class CMutableTransaction(CTransaction):
494498
"""A mutable transaction"""
495499
__slots__ = []
@@ -521,8 +525,6 @@ def from_tx(cls, tx):
521525
return cls(vin, vout, tx.nLockTime, tx.nVersion, tx.wit)
522526

523527

524-
525-
526528
class CBlockHeader(ImmutableSerializable):
527529
"""A block header"""
528530
__slots__ = ['nVersion', 'hashPrevBlock', 'hashMerkleRoot', 'nTime', 'nBits', 'nNonce']

bitcoin/core/scripteval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2012-2014 The python-bitcoinlib developers
1+
# Copyright (C) 2012-2017 The python-bitcoinlib developers
22
#
33
# This file is part of python-bitcoinlib.
44
#
@@ -816,7 +816,7 @@ def VerifySignature(txFrom, txTo, inIdx):
816816
raise VerifySignatureError("txin prevout.n >= len(txFrom.vout)")
817817
txout = txFrom.vout[txin.prevout.n]
818818

819-
if txin.prevout.hash != txFrom.GetHash():
819+
if txin.prevout.hash != txFrom.GetTxid():
820820
raise VerifySignatureError("prevout hash does not match txFrom")
821821

822822
VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, inIdx)

bitcoin/tests/test_scripteval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2013-2014 The python-bitcoinlib developers
1+
# Copyright (C) 2013-2017 The python-bitcoinlib developers
22
#
33
# This file is part of python-bitcoinlib.
44
#
@@ -89,7 +89,7 @@ def create_test_txs(self, scriptSig, scriptPubKey):
8989
txCredit = CTransaction([CTxIn(COutPoint(), CScript([OP_0, OP_0]), nSequence=0xFFFFFFFF)],
9090
[CTxOut(0, scriptPubKey)],
9191
nLockTime=0)
92-
txSpend = CTransaction([CTxIn(COutPoint(txCredit.GetHash(), 0), scriptSig, nSequence=0xFFFFFFFF)],
92+
txSpend = CTransaction([CTxIn(COutPoint(txCredit.GetTxid(), 0), scriptSig, nSequence=0xFFFFFFFF)],
9393
[CTxOut(0, CScript())],
9494
nLockTime=0)
9595
return (txCredit, txSpend)

release-notes.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
python-bitcoinlib release notes
2-
===============================
1+
# python-bitcoinlib release notes
32

4-
v0.7.0
5-
======
3+
## v0.8.0
4+
5+
Major breaking API change!
6+
7+
While this interim release doesn't by itself include segwit support, it does
8+
change the name of the `CTransaction/CMutableTransaction` method `GetHash()` to
9+
`GetTxid()` to prepare for a future segwit-enabled release. Incorrect calls to
10+
`GetHash()` will now raise a `AttributeError` exception with an explanation.
11+
12+
Since this release doesn't yet include segwit support, you will need to set the
13+
Bitcoin Core `-rpcserialversion=0` option, either as a command line argument,
14+
or in your `bitcoin.conf` file. Otherwise the RPC interface will return
15+
segwit-serialized transactions that this release's RPC support doesn't
16+
understand.
17+
18+
Other changes:
19+
20+
* Cookie file RPC authentication is now supported.
21+
* `msg_header` now correctly uses `CBlockHeader` rather than `CBlock`.
22+
* RPC `getbalance` now supports `include_watchonly`
23+
* RPC `unlockwallet` is now supported
24+
25+
26+
## v0.7.0
627

728
Breaking API changes:
829

@@ -25,8 +46,7 @@ Bugfixes:
2546
* Fixed a spurious `AttributeError` when `bitcoin.rpc.Proxy()` fails.
2647

2748

28-
v0.6.1
29-
======
49+
## v0.6.1
3050

3151
New features:
3252

@@ -36,8 +56,7 @@ New features:
3656
subtractfeefromamount arguments.
3757

3858

39-
v0.6.0
40-
======
59+
## v0.6.0
4160

4261
Breaking API changes:
4362

@@ -55,8 +74,7 @@ Breaking API changes:
5574
did anything with it anyway)
5675

5776

58-
v0.5.1
59-
======
77+
## v0.5.1
6078

6179
Various small bugfixes; see git history.
6280

@@ -66,8 +84,7 @@ New features:
6684
* OP_CHECKLOCKTIMEVERIFY opcode constant
6785

6886

69-
v0.5.0
70-
======
87+
## v0.5.0
7188

7289
Major fix: Fixed OpenSSL related crashes on OSX and Arch Linux. Big thanks to
7390
everyone who helped fix this!
@@ -90,8 +107,7 @@ Notable bugfixes:
90107
* getinfo() now works where disablewallet=1
91108

92109

93-
v0.4.0
94-
======
110+
## v0.4.0
95111

96112
Major fix: OpenSSL 1.0.1k rejects non-canonical DER signatures, which Bitcoin
97113
Core does not, so we now canonicalize signatures prior to passing them to
@@ -117,8 +133,7 @@ New features:
117133
* Added support for IPv6 addr messages
118134

119135

120-
v0.3.0
121-
======
136+
## v0.3.0
122137

123138
Major change: cleaned up what symbols are exported by modules. \_\_all\_\_ is now
124139
used extensively, which may break some applications that were not importing the
@@ -134,8 +149,7 @@ Other notable changes:
134149
* Various code cleanups and minor bug fixes.
135150

136151

137-
v0.2.1
138-
======
152+
## v0.2.1
139153

140154
* Improve bitcoin address handling. P2SH and P2PKH addresses now get their own
141155
classes - P2SHBitcoinAddress and P2PKHBitcoinAddress respectively - and P2PKH
@@ -146,8 +160,7 @@ v0.2.1
146160
* License is now LGPL v3 or later.
147161

148162

149-
v0.2.0
150-
======
163+
## v0.2.0
151164

152165
Major change: CTransaction, CBlock, etc. now come in immutable (default) and
153166
mutable forms. In most cases mutable and immutable can be used interchangeably;

0 commit comments

Comments
 (0)