diff --git a/pkg/rpc/client/rpc.go b/pkg/rpc/client/rpc.go index d0bca2474..0d8ca01ff 100644 --- a/pkg/rpc/client/rpc.go +++ b/pkg/rpc/client/rpc.go @@ -489,7 +489,7 @@ func (c *Client) CalculateValidUntilBlock() (uint32, error) { expiresAt: blockCount + cacheTimeout, } } - return blockCount + validatorsCount, nil + return blockCount + validatorsCount + 1, nil } // AddNetworkFee adds network fee for each witness script and optional extra diff --git a/pkg/rpc/client/rpc_test.go b/pkg/rpc/client/rpc_test.go index 5845b3065..8fea9d613 100644 --- a/pkg/rpc/client/rpc_test.go +++ b/pkg/rpc/client/rpc_test.go @@ -1321,14 +1321,14 @@ func TestCalculateValidUntilBlock(t *testing.T) { validUntilBlock, err := c.CalculateValidUntilBlock() assert.NoError(t, err) - assert.Equal(t, uint32(54), validUntilBlock) + assert.Equal(t, uint32(55), validUntilBlock) assert.Equal(t, 1, getBlockCountCalled) assert.Equal(t, 1, getValidatorsCalled) // check, whether caching is working validUntilBlock, err = c.CalculateValidUntilBlock() assert.NoError(t, err) - assert.Equal(t, uint32(54), validUntilBlock) + assert.Equal(t, uint32(55), validUntilBlock) assert.Equal(t, 2, getBlockCountCalled) assert.Equal(t, 1, getValidatorsCalled) }