Convert Bitcoin hash between display format and wire format. Bitcoin hashes are stored in reverse byte order in the wire protocol compared to how they're displayed in RPC calls.
(hash_hex)
| 5125 | |
| 5126 | |
| 5127 | def reverse_bitcoin_hash(hash_hex): |
| 5128 | """Convert Bitcoin hash between display format and wire format. |
| 5129 | |
| 5130 | Bitcoin hashes are stored in reverse byte order in the wire protocol |
| 5131 | compared to how they're displayed in RPC calls. |
| 5132 | """ |
| 5133 | return ''.join(reversed([hash_hex[i:i + 2] for i in range(0, len(hash_hex), 2)])) |
| 5134 | |
| 5135 | |
| 5136 | def test_bwatch_add_watch_creates_datastore_entry(node_factory, bitcoind): |
no test coverage detected