privval: allow passing options to NewSignerDialerEndpoint (#5434)

Required for #5291 to set timeouts for remote signers.
This commit is contained in:
Erik Grinaker
2020-09-30 18:45:46 +02:00
committed by GitHub
parent 01c32c62e8
commit b0130b4661
2 changed files with 7 additions and 0 deletions

View File

@@ -22,5 +22,7 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
### IMPROVEMENTS
- [privval] `NewSignerDialerEndpoint` can now be given `SignerServiceEndpointOption` (@erikgrinaker)
### BUG FIXES

View File

@@ -48,6 +48,7 @@ type SignerDialerEndpoint struct {
func NewSignerDialerEndpoint(
logger log.Logger,
dialer SocketDialer,
options ...SignerServiceEndpointOption,
) *SignerDialerEndpoint {
sd := &SignerDialerEndpoint{
@@ -56,6 +57,10 @@ func NewSignerDialerEndpoint(
maxConnRetries: defaultMaxDialRetries,
}
for _, optionFunc := range options {
optionFunc(sd)
}
sd.BaseService = *service.NewBaseService(logger, "SignerDialerEndpoint", sd)
sd.signerEndpoint.timeoutReadWrite = defaultTimeoutReadWriteSeconds * time.Second