HomePhabricator

util: move HasPrefix() so it can be reused

Description

util: move HasPrefix() so it can be reused

Summary:

Move the function `HasPrefix()` from `netaddress.cpp` to `util/string.h`
so it can be reused by `CNetAddr` methods (and possibly others).

Partial backport (1/4) of core PR19845:
https://github.com/bitcoin/bitcoin/pull/19845/commits/d2bb681f96fb327b4c4d5b2b113692ca22fdffbf

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9186

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Aug 31 2020, 08:39
FabienCommitted on Feb 9 2021, 16:57
FabienPushed on Feb 9 2021, 16:59
Reviewer
Restricted Project
Differential Revision
D9186: util: move HasPrefix() so it can be reused
Parents
rABCa8ce4f8ed85e: [backport#18727] test: Add CreateWalletFromFile test
Branches
Unknown
Tags
Unknown