mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-12 11:39:58 +02:00
negentropy: default frameSizeLimit to basically infinite.
This commit is contained in:
parent
1e4e91f257
commit
4c9ab850a5
@ -30,6 +30,12 @@ type Negentropy struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewNegentropy(storage Storage, frameSizeLimit int) *Negentropy {
|
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{
|
return &Negentropy{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
frameSizeLimit: frameSizeLimit,
|
frameSizeLimit: frameSizeLimit,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user