rpcserver: add time_lock_delta overflow check

This commit is contained in:
Eval EXEC committed 2023-03-23 21:34:12 +08:00
1 parent 3dc4ab736f
commit cbcbddfe29
6 files changed
+48 -8

No files matched your search

+4
View File
@@ -6827,6 +6827,10 @@ func (r *rpcServer) UpdateChannelPolicy(ctx context.Context,
return nil, fmt.Errorf("time lock delta of %v is too small, "+
"minimum supported is %v", req.TimeLockDelta,
minTimeLockDelta)
} else if req.TimeLockDelta > uint32(MaxTimeLockDelta) {
return nil, fmt.Errorf("time lock delta of %v is too big, "+
"maximum supported is %v", req.TimeLockDelta,
MaxTimeLockDelta)
}
baseFeeMsat := lnwire.MilliSatoshi(req.BaseFeeMsat)