Skip to content
Bitcoin Roots

v29.4-roots.1 · Commit 3: [PATCH 03/13] policy: restore conservative relay and network controls

src/protocol.h

Before: src/protocol.h · After: src/protocol.h

File metadata
index 804597b86d882f93b0c4bed7e10863b8d37e6ffe..ec39aed1c833fe7d7d5c0e1e7066d9def2a429ea 100644

Download original patch · Release notes

Diff rows 1–26 of 26. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

src/protocol.h CHANGED
@@ -484,9 +484,8 @@ enum GetDataMsg : uint32_t {
484
  MSG_CMPCT_BLOCK = 4, //!< Defined in BIP152
485
  MSG_WITNESS_BLOCK = MSG_BLOCK | MSG_WITNESS_FLAG, //!< Defined in BIP144
486
  MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG, //!< Defined in BIP144
487
- // MSG_FILTERED_WITNESS_BLOCK is defined in BIP144 as reserved for future
488
- // use and remains unused.
489
- // MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,
490
  };
491
 
492
  /** inv message data */
@@ -510,6 +509,7 @@ public:
510
  bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
511
  bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
512
  bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
 
513
 
514
  // Combined-message helper methods
515
  bool IsGenTxMsg() const
@@ -518,7 +518,7 @@ public:
518
  }
519
  bool IsGenBlkMsg() const
520
  {
521
- return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
522
  }
523
 
524
  uint32_t type;
 
484
  MSG_CMPCT_BLOCK = 4, //!< Defined in BIP152
485
  MSG_WITNESS_BLOCK = MSG_BLOCK | MSG_WITNESS_FLAG, //!< Defined in BIP144
486
  MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG, //!< Defined in BIP144
487
+ // BIP144 reserves this value; Roots supports it for filtered blocks with witness transactions.
488
+ MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,
 
489
  };
490
 
491
  /** inv message data */
 
509
  bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
510
  bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
511
  bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
512
+ bool IsMsgFilteredWitnessBlk() const { return type == MSG_FILTERED_WITNESS_BLOCK; }
513
 
514
  // Combined-message helper methods
515
  bool IsGenTxMsg() const
 
518
  }
519
  bool IsGenBlkMsg() const
520
  {
521
+ return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK || type == MSG_FILTERED_WITNESS_BLOCK;
522
  }
523
 
524
  uint32_t type;