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)
| 5002 | |
| 5003 | |
| 5004 | def reverse_bitcoin_hash(hash_hex): |
| 5005 | """Convert Bitcoin hash between display format and wire format. |
| 5006 | |
| 5007 | Bitcoin hashes are stored in reverse byte order in the wire protocol |
| 5008 | compared to how they're displayed in RPC calls. |
| 5009 | """ |
| 5010 | return ''.join(reversed([hash_hex[i:i + 2] for i in range(0, len(hash_hex), 2)])) |
| 5011 | |
| 5012 | |
| 5013 | def test_bwatch_add_watch_creates_datastore_entry(node_factory, bitcoind): |
no test coverage detected