You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
97d8770 proxy-types: add CustomHasField hook for nullable decode paths (Sjors Provoost)
8c2f102 refactor: add missing includes to mp/type-data.h (Sjors Provoost)
Pull request description:
Taken from: bitcoin/bitcoin#34020 (comment)
Let applications override `CustomHasField` so they can decide to treat certain capnproto values as being unset. For example, when converting `List(Data)` to `vector<shared_ptr<CTransaction>>`, mapping empty `Data` fields to null pointers.
This safe to do in special cases, like in this example because serialized `CTransaction` representations are never empty. It is also useful to do in this case because Cap'n Proto doesn't currently provide any API for distinguishing between unset and empty data values in a list (although they can be distinguished on the wire).
ACKs for top commit:
ryanofsky:
Code review ACK 97d8770. Confirmed no changes since last rebase.
Tree-SHA512: 34a9e9961a6e9334f21c684d9c89be98c85b6269852a6fc169ffdec47efb2a42b1e76e6d52090f448ed1a56d6995a8dde74d2c6a6fec75ca46bfd551a26e54cf
0 commit comments