Commit ab94a31
committed
Merge #130: Serialize msg_header using CBlockHeader instead of CBlock
3a9a162 Serialize msg_header using CBlockHeader instead of CBlock (str4d)
Pull request description:
This resolves an issue I uncovered while updating `pynode` to work with `python-bitcoinlib` 0.7.0. The following usage was previously allowable, because `CBlock` was mutable:
```py
db_block = self.chaindb.getblock(blkhash)
block = copy.copy(db_block)
block.vtx = []
msg.headers.append(block)
```
I [updated it](https://github.com/jgarzik/pynode/pull/19/files#diff-97b3827045a89ffba8170a14179aeb74L373) to the following, which resulted in the type error that this PR fixes:
```py
block = self.chaindb.getblock(blkhash)
msg.headers.append(block.get_header())
```
Tree-SHA512: ef324cd0baf04cb20a0e4d06425542ee86238527500544a8d1fde15ed2f91c138b536b90123ce6b19e43649a57ebc129cba72230801f1e96ab1f487717df158e1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
0 commit comments