LCOV - code coverage report
Current view: top level - src/script - keyorigin.h (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 8 8 100.0 %
Date: 2020-09-26 01:30:44 Functions: 18 18 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2019 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #ifndef BITCOIN_SCRIPT_KEYORIGIN_H
       6             : #define BITCOIN_SCRIPT_KEYORIGIN_H
       7             : 
       8             : #include <serialize.h>
       9             : #include <vector>
      10             : 
      11    15398216 : struct KeyOriginInfo
      12             : {
      13             :     unsigned char fingerprint[4]; //!< First 32 bits of the Hash160 of the public key at the root of the path
      14             :     std::vector<uint32_t> path;
      15             : 
      16        1608 :     friend bool operator==(const KeyOriginInfo& a, const KeyOriginInfo& b)
      17             :     {
      18        1608 :         return std::equal(std::begin(a.fingerprint), std::end(a.fingerprint), std::begin(b.fingerprint)) && a.path == b.path;
      19             :     }
      20             : 
      21      115074 :     SERIALIZE_METHODS(KeyOriginInfo, obj) { READWRITE(obj.fingerprint, obj.path); }
      22             : 
      23      671174 :     void clear()
      24             :     {
      25      671174 :         memset(fingerprint, 0, 4);
      26      671174 :         path.clear();
      27      671174 :     }
      28             : };
      29             : 
      30             : #endif // BITCOIN_SCRIPT_KEYORIGIN_H

Generated by: LCOV version 1.15