mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 06:04:42 +02:00
777aee77d1refactor: deduplicate keypath element parsing (pythcoiner)7d8fddfba2refactor: define BIP32_HARDENED and BIP32_UNHARDENED constants (pythcoiner) Pull request description: The codebase used raw `0x80000000` (and implicit `0`) as the bip32 hardened / unhardened flag. `ParseHDKeypath` and `ParseKeyPathNum` were two separate parsers for BIP32 keypath elements, #32784 aligned their rules (both accept ' and h as hardened marker and reject indexes > 0x7FFFFFFF), but the parsing logic itself was still duplicated. This PR: - Define `BIP32_HARDENED_FLAG` / `BIP32_UNHARDENED_FLAG` constants to replace magic `0x80000000` and `0` literals. - Add `ParseKeyPathElement` as bip32 parsing util and use it consistantly in `ParseHDKeyPath` and the descriptor keypath parser. ACKs for top commit: Sjors: ACK777aee77d1achow101: ACK777aee77d1Tree-SHA512: fb096eef82bb5a90baa7de41f5562b935665ee4b64c41586cf89e06c5633be44063a35a89d01a1432c8e63222d94bd06840bafc2a837f252013e317de0f5837a