negentropy: default frameSizeLimit to basically infinite.

This commit is contained in:
fiatjaf 2024-09-16 22:10:03 -03:00
parent 1e4e91f257
commit 4c9ab850a5

View File

@ -30,6 +30,12 @@ type Negentropy struct {
}
func NewNegentropy(storage Storage, frameSizeLimit int) *Negentropy {
if frameSizeLimit == 0 {
frameSizeLimit = math.MaxInt
} else if frameSizeLimit < 4096 {
panic(fmt.Errorf("frameSizeLimit can't be smaller than 4096, was %d", frameSizeLimit))
}
return &Negentropy{
storage: storage,
frameSizeLimit: frameSizeLimit,