Add log txids inside of inventories in big endian rather than little endian (#4013)

This commit is contained in:
Chris Stewart 2022-01-25 10:50:58 -06:00 committed by GitHub
parent e802254a20
commit dbfd58da86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,20 @@ case class Inventory(typeIdentifier: TypeIdentifier, hash: DoubleSha256Digest)
extends NetworkElement {
override def bytes: ByteVector = RawInventorySerializer.write(this)
override def toString: String = {
typeIdentifier match {
case TypeIdentifier.MsgTx | TypeIdentifier.MsgWitnessTx =>
//want to make a better toString here so it is easier to search txids
s"Inventory($typeIdentifier,txIdBE=${hash.flip.hex})"
case TypeIdentifier.MsgBlock | TypeIdentifier.MsgCompactBlock |
TypeIdentifier.MsgFilteredBlock | TypeIdentifier.MsgFilteredBlock |
TypeIdentifier.MsgCompactBlock |
TypeIdentifier.MsgFilteredWitnessBlock |
TypeIdentifier.MsgWitnessBlock | _: MsgUnassigned =>
super.toString
}
}
}
object Inventory extends Factory[Inventory] {