fanquake 4f5d3ce5a0
Merge bitcoin/bitcoin#24486: wallet: refactor: dedup sqlite blob binding
8ea6167099ddfe9a42464c3c8ae2acd895329d4f wallet: refactor: dedup sqlite blob binding (Sebastian Falbesoner)

Pull request description:

  This refactoring PR deduplicates repeated SQLite blob binding to a statement with a newly introduced helper function `BindBlobToStatement`, abstracting away the calls to `sqlite3_bind_blob(...)`.
  This should be more readable and less error-prone, e.g. in case that the error handling has to be adapted. As a slight drawback, the function where the binding happens is not printed anymore (`__func__`), i.e. one could argue this is not strictly a refactoring, but IMHO the advantages of deduplication outweigh this; binding errors are purely internal logic errors (wrong use of the sqlite API) rather than something that is dependend on external data like DB content.

ACKs for top commit:
  laanwj:
    Code review ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f
  achow101:
    ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f
  klementtan:
    ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f

Tree-SHA512: 1de0d214f836bc405a01e98a3a2d71f2deaddc7d23c31cad80219d1614bec92619c06d9a4a091dd563d3e95ffb879649c29745d8f89669b2a5330552c212af3f
2022-03-10 12:40:20 +00:00
..
2022-02-01 08:44:51 -03:00