mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-26 21:42:48 +01:00
Add better CETSignaturesV0TLV.toString so we don't accidentally DOS in the case of large amoutns of adaptor signatures (#3521)
This commit is contained in:
parent
b2065a9c02
commit
e829d03249
1 changed files with 9 additions and 0 deletions
|
@ -1404,6 +1404,15 @@ case class CETSignaturesV0TLV(sigs: Vector[ECAdaptorSignature])
|
|||
override val value: ByteVector = {
|
||||
bigSizePrefixedList(sigs)
|
||||
}
|
||||
|
||||
override def toString: String = {
|
||||
if (sigs.length <= 5) {
|
||||
super.toString
|
||||
} else {
|
||||
s"CETSignaturesV0TLV(sigs=${sigs.take(
|
||||
2)}..., omitting remainingSigs of length=${sigs.length - 2})"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object CETSignaturesV0TLV extends TLVFactory[CETSignaturesV0TLV] {
|
||||
|
|
Loading…
Add table
Reference in a new issue